这是我正在执行的代码。
import requests
session = requests.session()
session.proxies={}
session.proxies['http'] = 'socks5://localhost:9050'
session.proxies['https'] = 'socks5://localhost:9050'
r=session.get("http://secrdrop5wyphb5x.onion/")
print(r.status_code)
这是我收到的错误消息。
requests.exceptions.ConnectionError: SOCKSHTTPConnectionPool(host='secrdrop5wyphb5x.onion', port=80): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.contrib.socks.SOCKSConnection object at 0x7f9a1a949950>: Failed to establish a new connection: [Errno -2] Name or service not known',))