pevers / images-scraper

Simple and fast scraper for Google
ISC License
224 stars 69 forks source link

Only Sending One Image #70

Closed ghost closed 3 years ago

ghost commented 3 years ago

So I implemented this into a discord bot, and its only sending the same image, even after adding 200 after the search query in the code. How can I fix this?

MarceloBrazolim commented 3 years ago

It returns the json's in the order it appears in the web, you have to manually shuffle the resuls. I preffer the npm lodash to do so. but you can randomize it anyway you like.

const { shuffle } = require("lodash");
const result = shuffle(await google.scrape(query, 40));
pevers commented 3 years ago

Thanks for taking care of this @MarceloBrazolim . I think this can be closed.