Skip to content

Commit

Permalink
Support more selectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Ibrahimrahhal authored Jan 5, 2024
1 parent 2c725da commit e4ca02c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/google/scraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class GoogleScraper {
const linkElementHrefExpectedSelectors = ["a[href^='/imgres']", "a[jsaction]"];
const linkElementHref = linkElementHrefExpectedSelectors
.map(s => containerElement_.find(s).attr('href'))
.filter(e => e);
.find(e => e);
if (linkElementHref) { // linkElementHref could be undefined
const imageElementAlt = containerElement_.find('img').attr('alt');
const parsedLink = url.parse(linkElementHref, { parseQueryString: true });
Expand Down

0 comments on commit e4ca02c

Please sign in to comment.