4 ms·
I'm not generally a huge fan of javascript, but phantomjs/casperjs are far and away the best tools I've used for scraping. Two features that stood out: 1. It's
by nsp 14y ago
I'm not generally a huge fan of javascript, but phantomjs/casperjs are far and away the best tools I've used for scraping. Two features that stood out:
1. It's a headless WebKit browser, so it plays well with javascript and (sorta) flash.
2. It's easy to capture screenshots of the pages you're scraping, which is great for sanity checks later on.
Http://phantomjs.org - the main engine
Http://Casperjs.org - syntactic sugar for phantomjs
- ankimal 14y agoThey make scraping as easy as finding the right jquery selectors (once you inject jQuery onto the page) but can be very slow as compared to a vanilla HTML only scraper. In my experience, a phantom/casper implementation could take upwards of 5-10 secs. to process a single page (almost 5-10x slower). This, even if you disable load of remote images and plugins.
- zenocon 14y agoThere is a startup penalty to getting phantomjs executable up (including all of its WebKit internals), but once you're there, I've never had any performance issues. Roll a script using casper.each() and feed it an array of urls. It is typically very fast for me. You can trap on the page loaded event and do some benchmarking, but I would disagree with your premise that using PhantomJS/CasperJS is slow.