Hi,I'm trying to scrape a website using cheerio and request npm modules. I have an array of proxies and am trying to use one, but i keep getting the errorError: tunneling socket could not be established, cause=connect ECONNREFUSED IP-PROXY:80 . Basically, to prevent my IP from getting banned for scrapping the site, I'm using a list of proxys for my job. I am trying to use request npm module along with these proxies to perform a get request. My code isconst request = require('request') const proxyArray = ['IP:PORT:USER:PASS', 'IP2:PORT2:USER2:PASS2'] let r = request.defaults({ 'proxy': 'http://' + proxyArray[1] }) r.post(url, (err, resp)=>{ console.log(err) }) I always get the error as described above. How do i proceed?Thanks!
Submitted November 08, 2018 at 05:02PM by mclovin4009
No comments:
Post a Comment