'How to return to the origianl configuration of a SOCK5 proxy?
I am trying to connect to a web site to scrape some information. I was been ban for the server so I try this code
import socks
import socket
from urllib.request import urlopen
socks.set_default_proxy(socks.SOCKS5, "localhost", 9150)
socket.socket = socks.socksocket
print(urlopen('http://icanhazip.com').read())
It didn't work but now that I want to try diferent things I got this error
raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPSConnectionPool(host='es.wikipedia.org', port=443): Max retries exceeded with url: /wiki/Galba (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f81f0d2d7c0>: Failed to establish a new connection: Error connecting to SOCKS5 proxy localhost:9150: [Errno 61] Connection refused'))
I am thinking that has something to do with the previous code. Could someone help me? Thank you.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
