3 ms·
PhantomJS?
by checker659 13y ago
PhantomJS?
- egb 13y ago"PhantomJS is a headless WebKit scriptable with a JavaScript API", so it's a browser. Is it also a webscraper that can pull data out of a page for me?
- nols 13y agoI've heard of people using PhantomJS with CasperJS to scrape, not sure if it can be done solely with PhantomJS.
- vaviloff 13y agoCasperJS is a higher-level wrapper for PhantomJS, so - yes, it could be done with PhantomJS solely... But you wouldn't want to, because CasperJS makes automation easier.
- uptown 13y agoAre there any libraries to facilitate database-connectivity to SQL Server or MySQL from javascript? I've used CasperJS to scrape some sites, but always fall back on post-processing the scraped data with another program in order to get it into my database. I'd love to be able to do it all from one piece of code.
- gee_totes 13y agoYou could always have your CasperJS scraping script make an AJAX request to a RESTful API for your MySQL DB. You won't be doing it all from one piece of code, but you'll be doing about 90% of it.
- lost_my_pwd 13y agoSlimerJS too
- e1g 13y ago>Is it also a webscraper that can pull data out of a page for me? No, Phantom will only recreate the page as it would look like to a human user (i.e. after all javascript is parsed and executed). It will not help you parse or slice the page - you would have to do that part programatically with other dom-parsing tools.
- checker659 13y agoSorry. I guess you're right. As a programmer, both of those look the same to me.