pjscrape
pjscrape copied to clipboard
I am not able to output to file using pjscrape
I am trying to scrape the entire page and save it into a JSON file using PJScrape The following code runs and I can see the entire DOM in standard output, but I don't see the file scrape_output.json in the current directory
pjs.addSuite({
// single URL or array
url: 'http://en.wikipedia.org/wiki/List_of_towns_in_Vermont',
// single function or array, evaluated in the client
scraper: function() {
return $(document).text();
},
// options: 'json' or 'csv'
format: 'json',
// options: 'stdout' or 'file' (set in config.outFile)
writer: 'file',
outFile: 'scrape_output.json'
});
Exactly the same. This page http://nrabinowitz.github.io/pjscrape/#quickstart references certain "Save to File plugin", but the link is broken.
UPDATE. I was wrong. Writing is just fine, I mistyped writer name in pjs.config().