nrabinowitz / pjscrape

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

I am not able to output to file using pjscrape #53

Open jackygrahamez opened 10 years ago

jackygrahamez commented 10 years ago

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'
});
OnkelTem commented 9 years ago

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