pjscrape icon indicating copy to clipboard operation
pjscrape copied to clipboard

I am not able to output to file using pjscrape

Open jackygrahamez opened this issue 11 years ago • 1 comments

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'
});

jackygrahamez avatar Sep 06 '14 22:09 jackygrahamez

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().

OnkelTem avatar Sep 18 '14 14:09 OnkelTem