Closed snehal96 closed 4 years ago
Hey, using images-scraper, I keep on getting navigation error everytime! Also, if I try to push the results in an array it throws me with error!
`var express = require('express'), bodyparser = require('body-parser'), scraper = require('images-scraper'); var app = express(); var google = new scraper.Google(); app.set('port', process.env.PORT || 3000); app.set('view engine', 'ejs'); app.use(bodyparser.urlencoded({ extended: false })) app.get('/', function(req,res){ res.send("This is the home page"); }) app.get('/:id', function(req,res){ var id = req.params.id; console.log(id); google.list({ keyword: id, num: 10, detail: true, nightmare: { show: true } }) .then(function(res){ console.log('first 10 results from google', res); }).catch(function(err){ console.log(err); }) // var list = []; google.on('result', function (item) { console.log('out', item); // list.push(item); }); // res.send(list); }) app.listen(app.get('port'), function(err){ if(err) throw err; console.log('App is connected...'); })
` The error is:
`{ message: 'navigation error', code: -7, details: 'Navigation timed out after 30000 ms', url: 'https://www.google.com/search?q=hey%20there&source=lnms&tbm=isch&sa=X' }`
Revamped everything. If this is still an issue please check. I'm closing it.
Hey, using images-scraper, I keep on getting navigation error everytime! Also, if I try to push the results in an array it throws me with error!
` The error is: