2019-06-11 18:16:59 +02:00
|
|
|
const se_scraper = require('./../src/node_scraper.js');
|
2019-03-10 20:02:42 +01:00
|
|
|
|
2019-06-11 18:16:59 +02:00
|
|
|
(async () => {
|
|
|
|
let browser_config = {
|
|
|
|
headless: true,
|
|
|
|
debug_level: 1,
|
|
|
|
output_file: 'examples/results/amazon.json',
|
|
|
|
amazon_settings: {
|
|
|
|
amazon_domain: 'amazon.com',
|
|
|
|
}
|
|
|
|
};
|
2019-03-10 20:02:42 +01:00
|
|
|
|
2019-06-11 18:16:59 +02:00
|
|
|
let scrape_job = {
|
|
|
|
search_engine: 'amazon',
|
|
|
|
keywords: ['iphone', 'drone'],
|
|
|
|
num_pages: 1,
|
|
|
|
};
|
2019-03-10 20:02:42 +01:00
|
|
|
|
2019-06-11 18:16:59 +02:00
|
|
|
var scraper = new se_scraper.ScrapeManager(browser_config);
|
|
|
|
await scraper.start();
|
|
|
|
|
|
|
|
var results = await scraper.scrape(scrape_job);
|
|
|
|
console.dir(results, {depth: null, colors: true});
|
|
|
|
await scraper.quit();
|
|
|
|
})();
|