nrabinowitz / pjscrape

A web-scraping framework written in Javascript, using PhantomJS and jQuery
http://nrabinowitz.github.io/pjscrape/
MIT License
996 stars 159 forks source link

Scrape website #55

Closed acuatoria closed 10 years ago

acuatoria commented 10 years ago

I'm trying to save the html in a web with this code, but no result A help would be much appreciated.

var scraper = function() { return $().html();

};

pjs.addSuite({ url: 'http://www.expoquimia.com/exhibitors', moreUrls: function() { return _pjs.getAnchorUrls('li a'); }, maxDepth: 1, scraper: scraper });

pjs.config({ // options: 'stdout', 'file' (set in config.logFile) or 'none' log: 'stdout', // options: 'json' or 'csv' format: 'json', // options: 'stdout' or 'file' (set in config.outFile) writer: 'file', outFile: 'scrape_output.json' });

nrabinowitz commented 10 years ago

Have you tried $(document).html() ?

This is a jQuery issue, not a pjscrape one - try the code out in the browser console first, as it's much easier to debug.