images-scraper: Example code returns an empty array.
I went through a debugging hell of things, until I realized that even your example will only return an empty array, at least on my computer. With a fresh install of Node 12, a new project initialized with npm init and just your dependency and your example code, I was not able to get ANY result what so ever.
Terminal Things.
➜ test node:(v12.16.1) npm start
> test@1.0.0 start /Users/alt/Documents/Code/_private/test
> node index.js
results []
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 35 (11 by maintainers)
I wrote my own solutions for Yahoo and Ecosia, I tried Yandex, but it seems to be a bit complex. https://github.com/IamRifki/alt-image-scraper
Hey, so after a while I made a script that actually works. One thing to keep in mind if you’re going to implement step number 3 (Right click item) is to not use puppeteer for sending right clicks. Just send a “mousedown” MouseEvent in the browser which is almost instant.
Here’s a gist containing my approach: https://gist.github.com/smokes/f951a219e85058a051bf11ef8e72780d
The links are rendered and start with “/imgres?imgurl” when you right click the item. So we don’t have to actually load the full res image.
Google removed meta data. The current image urls are in the js script. The link is added to DOM after the click on thumbnail to open the preview