两个t都能正常浏览网页,但是都连接失败......
`D:\runtime\Python\python.exe E:\Downloads\twitter_download-main\main.py
获取信息失败
Traceback (most recent call last):
File "D:\runtime\Python\lib\site-packages\httpcore_exceptions.py", line 10, in map_exceptions
yield
File "D:\runtime\Python\lib\site-packages\httpcore_backends\sync.py", line 168, in start_tls
raise exc
File "D:\runtime\Python\lib\site-packages\httpcore_backends\sync.py", line 163, in start_tls
sock = ssl_context.wrap_socket(
File "D:\runtime\Python\lib\ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "D:\runtime\Python\lib\ssl.py", line 1040, in _create
self.do_handshake()
File "D:\runtime\Python\lib\ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
OSError: [Errno 0] Error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\runtime\Python\lib\site-packages\httpx_transports\default.py", line 66, in map_httpcore_exceptions
yield
File "D:\runtime\Python\lib\site-packages\httpx_transports\default.py", line 228, in handle_request
resp = self._pool.handle_request(req)
File "D:\runtime\Python\lib\site-packages\httpcore_sync\connection_pool.py", line 268, in handle_request
raise exc
File "D:\runtime\Python\lib\site-packages\httpcore_sync\connection_pool.py", line 251, in handle_request
response = connection.handle_request(request)
File "D:\runtime\Python\lib\site-packages\httpcore_sync\http_proxy.py", line 289, in handle_request
connect_response = self._connection.handle_request(
File "D:\runtime\Python\lib\site-packages\httpcore_sync\connection.py", line 99, in handle_request
raise exc
File "D:\runtime\Python\lib\site-packages\httpcore_sync\connection.py", line 76, in handle_request
stream = self._connect(request)
File "D:\runtime\Python\lib\site-packages\httpcore_sync\connection.py", line 156, in _connect
stream = stream.start_tls(**kwargs)
File "D:\runtime\Python\lib\site-packages\httpcore_backends\sync.py", line 168, in start_tls
raise exc
File "D:\runtime\Python\lib\contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "D:\runtime\Python\lib\site-packages\httpcore_exceptions.py", line 14, in map_exceptions
raise to_exc(exc) from exc
httpcore.ConnectError: [Errno 0] Error
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "E:\Downloads\twitter_download-main\main.py", line 84, in get_other_info
response = httpx.get(url, headers=_headers, proxies=proxies).text
File "D:\runtime\Python\lib\site-packages\httpx_api.py", line 189, in get
return request(
File "D:\runtime\Python\lib\site-packages\httpx_api.py", line 100, in request
return client.request(
File "D:\runtime\Python\lib\site-packages\httpx_client.py", line 814, in request
return self.send(request, auth=auth, follow_redirects=follow_redirects)
File "D:\runtime\Python\lib\site-packages\httpx_client.py", line 901, in send
response = self._send_handling_auth(
File "D:\runtime\Python\lib\site-packages\httpx_client.py", line 929, in _send_handling_auth
response = self._send_handling_redirects(
File "D:\runtime\Python\lib\site-packages\httpx_client.py", line 966, in _send_handling_redirects
response = self._send_single_request(request)
File "D:\runtime\Python\lib\site-packages\httpx_client.py", line 1002, in _send_single_request
response = transport.handle_request(request)
File "D:\runtime\Python\lib\site-packages\httpx_transports\default.py", line 228, in handle_request
resp = self._pool.handle_request(req)
File "D:\runtime\Python\lib\contextlib.py", line 131, in exit
self.gen.throw(type, value, traceback)
File "D:\runtime\Python\lib\site-packages\httpx_transports\default.py", line 83, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 0] Error
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Downloads\twitter_download-main\main.py", line 287, in
main(User_info(i))
File "E:\Downloads\twitter_download-main\main.py", line 266, in main
if not get_other_info(_user_info):
File "E:\Downloads\twitter_download-main\main.py", line 93, in get_other_info
print(response)
UnboundLocalError: local variable 'response' referenced before assignment
Process finished with exit code 1
`