thibauts / node-google-search-scraper

Google search scraper with captcha solving support
MIT License
89 stars 40 forks source link

Error: getaddrinfo ENOTFOUND www.google.comundefined www.google.comundefined:443 #14

Open pankaj2k9 opened 5 years ago

pankaj2k9 commented 5 years ago

Hi,

I am getting following issue :


{ Error: getaddrinfo ENOTFOUND www.google.comundefined www.google.comundefined:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'www.google.comundefined',
  host: 'www.google.comundefined',
  port: 443 }
/Users/pankaj/work/genderapp/index.js:27

And here is my code:

const csvFilePath = './names_score_alltime.csv';
const csv = require('csvtojson');
const scraper = require('google-search-scraper');
const DeathByCaptcha = require('deathbycaptcha');

const dbc = new DeathByCaptcha('pankaj2k9', '...mypassord....');
let names = [];
csv()
    .fromFile(csvFilePath)
    .then((jsonObj) => {
        jsonObj.forEach((singleScore) => {
            names.push(singleScore.first);
        })
    })

let options = {
    query: 'information theory',
    age: 'y',
    solver: dbc
};

let urls = [];
scraper.search(options, (err, url) => {
    console.log(err);
    if (err) throw err;
    urls.push(url);
    Promise.all(urls).then((values) => {
        console.log(values);
    });
});
rajathans commented 5 years ago

Did you find any solution for this?

SlehMas commented 5 years ago

This exception occurs when you query too many times in a small time span. Change your IP address or wait for an hour or two and try again.

PS: Too many times and your IP gets blacklisted.