node-phantom-simple icon indicating copy to clipboard operation
node-phantom-simple copied to clipboard

Phantom Process died

Open toddwprice opened this issue 9 years ago • 2 comments

Certain pages are causing the "Phantom Process died" error to be raised after 30 seconds. If I use a simple phantomjs script directly, the same page loads just fine, though it takes longer than 30 seconds.

Here's an example:

var driver = require('node-phantom-simple');
var url = 'http://www.ebay.com/itm/Hybrid-VERGE-Accessory-Hard-Silicone-Case-Cover-Gel-Apple-iPhone-5S-SE-/301884820233?var=600695910819';

driver.create(function (err, browser) {
  browser.createPage(function (err, page) {
    page.open(url, function (err, status) {
      if (err) console.log('error', err);
      else {
        console.log('done');
      }
    });
  });
});

Running the following script with phantomjs myScript.js works fine though:

var page = require('webpage').create();
var url = 'http://www.ebay.com/itm/Hybrid-VERGE-Accessory-Hard-Silicone-Case-Cover-Gel-Apple-iPhone-5S-SE-/301884820233?var=600695910819';
page.open(url', function() {
  page.render('ebay.png');
  phantom.exit();
});

Is there a default timeout of 30 seconds in one of the underlying calls perhaps?

toddwprice avatar Jul 26 '16 14:07 toddwprice

https://github.com/baudehlo/node-phantom-simple/blob/2.2.4/bridge.js#L13

We could do watchdog timeout tuneable. But in fact, freezing browser for 30 seconds is NOT normal.

puzrin avatar Sep 08 '16 15:09 puzrin

It is not normal but it happens notably when you tend to execute a lot of phantom processes in parallel. The mean time augment considerably. Making it customizable would be great indeed.

jeandat avatar Dec 28 '16 16:12 jeandat