Unable to use Tor with Python Requests
import requests
proxies = {
'http': 'socks5://localhost:9050',
'https': 'socks5://localhost:9050'
}
url = 'http://httpbin.org/ip'
print(requests.get(url, proxies=proxies).text)
I have tried a multitude of solutions, none of which worked for me. I am trying to make simple requests with Python through Tor. Thanks in advance.
Error:
requests.exceptions.ConnectionError: SOCKSHTTPSConnectionPool(host='canihazip.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('< urllib3.contrib.socks.SOCKSHTTPSConnection object at 0x031B77F0>: Failed to esta blish a new connection: [Errno 10061] No connection could be made because the ta rget machine actively refused it',))