Skip to content

Commit

Permalink
fix: bump version to 6.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pevers committed Jan 22, 2024
1 parent 3e81f41 commit 8b737ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
9 changes: 5 additions & 4 deletions src/google/scraper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8b737ae

Please sign in to comment.