1

PhantomJS is having an intermittent problem completing page loads for me.

The last thing I see in the output from --debug=true is

2015-03-21T21:26:39 [DEBUG] WebPage - updateLoadingProgress: 86

Other people have noticed similar-sounding issues as well:

My question for the SO community is -- has anyone found a good workaround or identified what might be triggering this condition in the page load?

wrschneider
  • 17,913
  • 16
  • 96
  • 176

1 Answers1

0

I was facing this same problem using phantomjs in an R script and finally found a workaround. See the comment from vasi on this page:

Command line command to auto-kill a command after a certain amount of time

Where he/she gives this bit of command line perl code that will allow you to kill the phantomjs process if it doesn't complete after a given amount of time.

perl -e '$s = shift; $SIG{ALRM} = sub { print STDERR "Timeout!\n"; kill INT => $p }; exec(@ARGV) unless $p = fork; alarm $s; waitpid $p, 0' 10 phantomjs file.js
Community
  • 1
  • 1
Scott
  • 131
  • 8