By janober
Have a very strange problem. Since 1-2 weeks I am unable to create screenshots of a Craigslist pages with PhantomJS on Digital Ocean. Does anybody have any idea what the issue could be and why it does not work anymore?
It always worked fine before and still works totally fine when I run it locally on my notebook or on linode. It creates the screenshot within 2-4 seconds. However running the same (no matter if in a special Docker-Container like the one used locally and linode or installed directly on the host) on Digital Ocean keeps on loading forever and if I am lucky and wait long enough I get the screenshot after around 7-10+ minutes.
Tried it on different Droplets (existing & totally new) in different zones (SF & Frankfurt) but always have the same issue. Already contacted Digital Ocean about that. They were able to reproduce the issue but according to them nothing changed on their side and have so also no idea what could cause that. They blame PhantomJS or Craigslist.
It can be reproduced very easily. On a new Droplet (Ubuntu 14.04) the following code will install PhantomJS:
# Install dependencies
sudo apt-get install -y libicu52 libjpeg8 libfontconfig libwebp5
# Install PhantomJS
cd /usr/local/share && \
curl -L -O https://github.com/bprodoehl/phantomjs/releases/download/v2.0.0-20150528/phantomjs-2.0.0-20150528-u1404-x86_64.zip && \
unzip phantomjs-2.0.0-20150528-u1404-x86_64.zip && \
ln -s /usr/local/share/phantomjs-2.0.0-20150528/bin/phantomjs /usr/local/bin/phantomjs
A very basic example script to create a screenshot of a product on craigslist. File called “test-screenshot.js” with this content:
var page = require('webpage').create();
var url = 'http://vancouver.craigslist.ca/van/ctd/5162270100.html';
page.open(url, function() {
page.render('craigslist.png');
phantom.exit();
});
To run the script: “phantomjs test-screenshot.js”.
Does anybody have any idea what is going on?
Thanks!
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi, I’m about to go through the process of getting PhantomJS/CasperJS running on an Ubuntu 14 droplet.
Questions:
Follow these instructions for installation and setup. This will get you:
node 4.0.0 npm 3.3.5 phantomjs 1.9.8 casperjs 1.1.0-beta3
Can confirm that the following code works: casper.then(function() { casper.capture(“confirm_purchase.png”,{ top: 0, left: 0, width: 768, height: 768 }); });
ubuntu 14.04: sudo apt-get update sudo apt-get install git
nodejs: https://github.com/nodejs/node-v0.x-archive/wiki/Installing-Node.js-via-package-manager?utm_source=[deliciuos]&utm_medium=twitter#debian-and-ubuntu-based-linux-distributions https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server
npm: http://stackoverflow.com/questions/23393707/how-to-update-npm https://docs.npmjs.com/getting-started/installing-node
phantomjs: https://gist.github.com/julionc/7476620
casperjs: http://docs.casperjs.org/en/latest/installation.html
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.