UNPKG

gotranslate-phrase-scrapper

Version:

GoTranslate Phrase Scrapper component for GoTranslate Framework, which scraps translatable phrases from remote websites.

21 lines (17 loc) 624 B
//var url = "http://example.com/"; var url = "http://en.wikipedia.org/wiki/Main_Page"; var gotps = require('../index'); // Hint: Configurable Options [optional] gotps.setScrapperOptions({ includeHeaders: true // default false, Controls 'header' property inclusion. , includeMetadata: true // default false, Controls 'header' property inclusion. , includeFrames: true // default false, Controls 'header' property inclusion. }); // Hint: If setScrapper gotps.scrape(url, function (err, phrases) { if (err) { console.log(err); } else { console.log(JSON.stringify(phrases, null, "\t")); } });