diff --git a/package.json b/package.json index 583f7f0..52c1433 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "images-scraper", - "version": "6.4.3", + "version": "6.4.4", "description": "Simple scraper for Google images using Puppeteer", "main": "src/index.js", "scripts": { diff --git a/src/google/scraper.js b/src/google/scraper.js index 8f04422..b997a5e 100644 --- a/src/google/scraper.js +++ b/src/google/scraper.js @@ -197,11 +197,12 @@ class GoogleScraper { $('#islrg div[jsaction][data-tbnid]').each(function (_i, containerElement) { const containerElement_ = $(containerElement); - const linkElementHrefExpectedSelectors = ["a[href^='/imgres']", "a[jsaction]"]; + const linkElementHrefExpectedSelectors = ["a[href^='/imgres']", 'a[jsaction]']; const linkElementHref = linkElementHrefExpectedSelectors - .map(s => containerElement_.find(s).attr('href')) - .find(e => e); - if (linkElementHref) { // linkElementHref could be undefined + .map((s) => containerElement_.find(s).attr('href')) + .find((e) => e); + if (linkElementHref) { + // linkElementHref could be undefined const imageElementAlt = containerElement_.find('img').attr('alt'); const parsedLink = url.parse(linkElementHref, { parseQueryString: true }); const imageurl = parsedLink.query.imgurl;