faster scraping, added ticker search engines

This commit is contained in:
Nikolai Tschacher
2019-01-27 01:27:52 +01:00
parent b0e588f916
commit e78d7145b5
13 changed files with 244 additions and 63 deletions

View File

@ -6,8 +6,7 @@ module.exports = {
scrape_bing_news_pup: scrape_bing_news_pup,
};
async function scrape_bing_pup(browser, event, context) {
const page = await browser.newPage();
async function scrape_bing_pup(page, event, context) {
await page.goto('https://www.bing.com/');
try {
@ -91,8 +90,7 @@ function parse(html) {
}
}
async function scrape_bing_news_pup(browser, event, context) {
const page = await browser.newPage();
async function scrape_bing_news_pup(page, event, context) {
await page.goto('https://www.bing.com/news/search?');
if (event.set_manual_settings === true) {