Crawlme icon indicating copy to clipboard operation
Crawlme copied to clipboard

Seems like the zombie api changed?

Open alexanderkjeldaas opened this issue 11 years ago • 1 comments

According to this:

https://groups.google.com/forum/#!msg/zombie-js/qOS0W_cMCgQ/4iFcqLjVEPgJ

It seems like this code in crawlme.js cannot work because the callback doesn't get browser. Simply removing the browser argument from the callback seems to fix the issue.

browser.visit(url, {waitFor: options.waitFor},
  function(err, browser, status) {
    if(err) return cb(err);

    // links
    var links = browser.queryAll('a'); // browser is undefined
    links.forEach(function(link) {
      var href = link.getAttribute('href');
      var absoluteUrl = urlParser.resolve(url, href);
      link.setAttribute('href', absoluteUrl);
    });

alexanderkjeldaas avatar Mar 16 '14 20:03 alexanderkjeldaas

We are calling Browser.visit() which is different from (new Browser()).visit() so this should work fine. Are you getting an error?

arokor avatar Apr 07 '14 20:04 arokor