diff --git a/src/modules/bing.js b/src/modules/bing.js index d536761..a888c8f 100644 --- a/src/modules/bing.js +++ b/src/modules/bing.js @@ -47,6 +47,21 @@ class BingScraper extends Scraper { async load_start_page() { let startUrl = this.build_start_url('https://www.bing.com/search?') || 'https://www.bing.com/'; + if (this.config.bing_settings) { + startUrl = `https://www.${this.config.bing_settings.bing_domain}/search?`; + if (this.config.bing_settings.bing_domain) { + startUrl = `https://www.${this.config.bing_settings.bing_domain}/search?`; + } else { + startUrl = `https://www.bing.com/search?`; + } + + for (var key in this.config.bing_settings) { + if (key !== 'bing_domain') { + startUrl += `${key}=${this.config.bing_settings[key]}&` + } + } + } + try { await this.page.goto(startUrl); await this.page.waitForSelector('input[name="q"]', { timeout: this.STANDARD_TIMEOUT }); @@ -171,4 +186,4 @@ class BingNewsScraper extends Scraper { module.exports = { BingNewsScraper: BingNewsScraper, BingScraper: BingScraper, -}; \ No newline at end of file +};