pjscrape icon indicating copy to clipboard operation
pjscrape copied to clipboard

How to keep the result in a variable?

Open vallieres opened this issue 10 years ago • 0 comments

Hello,

I would like to keep the result in a variable for subsequent manipulation. In JS terms, is there a complete event I can attach a function to?

Similar to:

pjs.addSuite({
    url: urlCPB,
    moreUrls: '#recherche > table > tbody > tr > td.torrent-aff > a',
    maxDepth: 1,
    scraper: function() {
        return {
            name: $('#center-middle > div.content > div.torrent > h1').text(),
            fileSize: $('#center-middle > div.content > div.torrent > div:nth-child(6) > fieldset > strong:nth-child(2)').text(),
            torrent: $('#center-middle > div.content > div.torrent > div:nth-child(8) > div:nth-child(2) > a').attr('href')
        };
    },
    complete: function(data){
        console.log('This is the final data object being scrapped: ' + data);
    }
});

vallieres avatar Nov 11 '14 19:11 vallieres