I am trying to build a selenium scraper that rotate its IP address after every n request, for this i need to access a free proxy website in order to construct a list of IP:port addresses, the problem is that i am executing my code from a country that bans proxy websites, thus the code can't access the proxy website and is returning me this error: raise URLError(err) urllib.error.URLError: urlopen error [Errno 104] Connection reset by peer
Here is my part of code that try to access https://www.sslproxies.org/ website:
ua = UserAgent() # From here we generate a random user agent
proxies = [] # Will contain proxies [ip, port]
proxies_req = Request('https://www.sslproxies.org/')
proxies_req.add_header('User-Agent', ua.random)
proxies_doc = urlopen(proxies_req).read().decode('utf8')
soup = BeautifulSoup(proxies_doc, 'html.parser')
proxies_table = soup.find(id='proxylisttable')
The error is occuring from the fifth line :
proxies_doc = urlopen(proxies_req).read().decode('utf8')
any suggestions?