prolificinteractive / node-html-to-json

Parses HTML strings into objects using flexible, composable filters.
MIT License
120 stars 13 forks source link

Trying to get the Batch example to work #9

Open markdorrill opened 5 years ago

markdorrill commented 5 years ago

I'm trying to get the example in htmlToJson.batch to work but dont understand what the getProlificHomepage() function should look like or return.

Currently I'm trying the following request. It returns html but not a promise that the batch chain can operate on.

var getProlificHomepage = htmlToJson.request('http://prolificinteractive.com', {
        'text': function ($doc) {
            return $doc.text();
        }
    }, function (err, result) {
        console.log(result);
    });