mirror of
https://github.com/NikolaiT/se-scraper.git
synced 2024-11-25 09:03:10 +01:00
24 lines
570 B
JavaScript
24 lines
570 B
JavaScript
const se_scraper = require('./src/node_scraper.js');
|
|
var Scraper = require('./src/modules/se_scraper');
|
|
|
|
async function scrape(browser_config, scrape_config) {
|
|
// scrape config overwrites the browser_config
|
|
Object.assign(browser_config, scrape_config);
|
|
|
|
var scraper = new se_scraper.ScrapeManager(browser_config);
|
|
|
|
await scraper.start();
|
|
|
|
var results = await scraper.scrape(scrape_config);
|
|
|
|
await scraper.quit();
|
|
|
|
return results;
|
|
}
|
|
|
|
module.exports = {
|
|
scrape: scrape,
|
|
ScrapeManager: se_scraper.ScrapeManager,
|
|
Scraper: Scraper,
|
|
};
|