mirror of
https://github.com/NikolaiT/se-scraper.git
synced 2025-01-27 06:38:34 +01:00
Use bing_setting.bing_domain if defined for startUrl
This commit is contained in:
parent
a3ebe357a4
commit
a0e63aa4b0
@ -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 });
|
||||
|
Loading…
Reference in New Issue
Block a user