mirror of
https://github.com/NikolaiT/se-scraper.git
synced 2025-01-12 07:48:10 +01:00
Remove uneeded try catch block in Google Search module
This commit is contained in:
parent
0db6e068da
commit
dde2b14fc0
@ -1,3 +1,4 @@
|
||||
'use strict';
|
||||
const cheerio = require('cheerio');
|
||||
const Scraper = require('./se_scraper');
|
||||
const common = require('./common.js');
|
||||
@ -175,11 +176,7 @@ class GoogleScraper extends Scraper {
|
||||
|
||||
this.last_response = await this.page.goto(startUrl);
|
||||
|
||||
try {
|
||||
await this.page.waitForSelector('input[name="q"]', { timeout: this.STANDARD_TIMEOUT });
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
await this.page.waitForSelector('input[name="q"]', { timeout: this.STANDARD_TIMEOUT });
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -253,12 +250,9 @@ class GoogleNewsOldScraper extends Scraper {
|
||||
async load_start_page() {
|
||||
let startUrl = this.build_start_url('https://www.google.com/search?source=lnms&tbm=nws&') || 'https://www.google.com/search?source=lnms&tbm=nws';
|
||||
|
||||
try {
|
||||
await this.page.goto(startUrl);
|
||||
await this.page.waitForSelector('input[name="q"]', { timeout: this.STANDARD_TIMEOUT });
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user