headless - PhantomJS page.open freezes -
I am trying to open a website using PhantomJS using the capture example
< Code> var page = ('webpage') is required create () Page.open ('http://github.com/', function () {page.render ('github.png'); phantom.exit ();});
This code works fine on my local machine, using Ubuntu 14.04. But when I run the code on the virtual server, callback never calls and the script does not exit the server and my local machine exact same setup is in progress. I tried to virtualize it with VMWare and on 2 different servers with Virtuozzo.
This does not appear to be a network error because all requests are successful.
Actually UserAgent caused all the hassle @ Kalam-B asked me about this question Told. The only difference is that the image file for me was never created
with the UserAgent setting
page.settings.userAgent = 'Mozilla / 5.0 (Windows NT 6.3 ; Win64; x64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 37.0.2049.0 Safari / 537.36 ';
Really solved the problem.
Comments
Post a Comment