node-google
node-google copied to clipboard
How can i skip some results?
I want to skip some results that i already visited. How can i skip some results based on a condition in my code?
If you need to offset the results that are returned, then just pass the optional "start" parameter into the google function. This will return from the 3rd page of results:
google ('test query', 20, ( err, res ) => {
if (err) console.error(err)
for (var i = 0; i < res.links.length; ++i) {
var link = res.links[i];
console.log(link.title + ' - ' + link.href)
console.log(link.description + "\n")
}
if (nextCounter < 4) {
nextCounter += 1
if (res.next) res.next()
}
})