HTTPSConnectionPool(host='stats.nba.com', port=443): Read timed out. (read timeout=None)
See original GitHub issueSee this error in Logs. I have no proxy, VPN. Direct Internet. This is the full Python Script: https://pastebin.com/u5VS9QPn
Expected Result
No errors.
Actual Result
Traceback (most recent call last): File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 384, in _make_request six.raise_from(e, None) File “<string>”, line 2, in raise_from File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 380, in _make_request httplib_response = conn.getresponse() File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py”, line 1331, in getresponse response.begin() File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py”, line 297, in begin version, status, reason = self._read_status() File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py”, line 258, in _read_status line = str(self.fp.readline(_MAXLINE + 1), “iso-8859-1”) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py”, line 586, in readinto return self._sock.recv_into(b) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 1009, in recv_into return self.read(nbytes, buffer) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 871, in read return self._sslobj.read(len, buffer) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py”, line 631, in read v = self._sslobj.read(len, buffer) TimeoutError: [Errno 60] Operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py”, line 445, in send timeout=timeout File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 638, in urlopen _stacktrace=sys.exc_info()[2]) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/util/retry.py”, line 367, in increment raise six.reraise(type(error), error, _stacktrace) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/packages/six.py”, line 686, in reraise raise value File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 600, in urlopen chunked=chunked) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 386, in _make_request self._raise_timeout(err=e, url=url, timeout_value=read_timeout) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/urllib3/connectionpool.py”, line 317, in _raise_timeout raise ReadTimeoutError(self, url, “Read timed out. (read timeout=%s)” % timeout_value) urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘stats.nba.com’, port=443): Read timed out. (read timeout=None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File “/Users/perksofthesewalls/Documents/Reddit/r:Warriors/Python/warriorssidebar6.py”, line 145, in <module> data = getUrlContent2(url) File “/Users/perksofthesewalls/Documents/Reddit/r:Warriors/Python/warriorssidebar6.py”, line 16, in getUrlContent2 response = requests.get(url, headers=headers) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/api.py”, line 72, in get return request(‘get’, url, params=params, **kwargs) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/api.py”, line 58, in request return session.request(method=method, url=url, **kwargs) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py”, line 512, in request resp = self.send(prep, **send_kwargs) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py”, line 644, in send history = [resp for resp in gen] if allow_redirects else [] File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py”, line 644, in <listcomp> history = [resp for resp in gen] if allow_redirects else [] File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py”, line 222, in resolve_redirects **adapter_kwargs File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/sessions.py”, line 622, in send r = adapter.send(request, **kwargs) File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/requests/adapters.py”, line 526, in send raise ReadTimeout(e, request=request) requests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘stats.nba.com’, port=443): Read timed out. (read timeout=None)
Reproduction Steps
import requests
System Information
$ python -m requests.help
<paste here>
This command is only available on Requests v2.16.4 and greater. Otherwise, please provide some basic information about your system (Python version, operating system, &c).
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (1 by maintainers)
Top GitHub Comments
Use Google Chrome and go here (https://www.whatismybrowser.com/detect/what-is-my-user-agent) and then copy the User-Agent and paste to your code like below: headers={ “User-Agent”:“your User-Agent”}
type tho headers in requests.get tag like this: res = requests.get(url, headers=headers)
How do you do that ? theres = requests.get(url, headers=headers) part