when i do just one request it's 200 OK r =…
- User
when i do just one request it's 200 OK r = s.get(f'https://2ch.hk/{random_board}/res/{random_thread}.html', timeout=10)
or when i do just this it's 200 OK s.get(f'https://2ch.hk/{random_board}.html', timeout=10)
but when i do this: s = niquests.Session()
r = s.get(f'https://2ch.hk/{random_board}/res/{random_thread}.html', timeout=10)
s.get(f'https://2ch.hk/{random_board}.html', timeout=10)
r = s.get(f'https://2ch.hk/{random_board}/res/{random_thread}.html', timeout=10) print(r)
i get this error. Traceback (most recent call last): File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\niquests\adapters.py", line 896, in send resp_or_promise = conn.urlopen( # type: ignore[call-overload] File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 1459, in urlopen retries = retries.increment( File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\retry.py", line 495, in increment raise reraise(type(error), error, _stacktrace) File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\util\util.py", line 39, in reraise raise value File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 1383, in urlopen response = self._make_request( # type: ignore[call-overload,misc] File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 986, in _make_request raise new_e File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 964, in _make_request self._raise_timeout(err=e, url=url, timeout_value=conn.timeout) File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\urllib3\connectionpool.py", line 622, in _raise_timeout raise ReadTimeoutError( urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='2ch.hk', port=443): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\Plathera\Desktop\test niquests.py", line 10, in r = s.get(f'https://2ch.hk/{random_board}/res/{random_thread}.html', timeout=10) File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\niquests\sessions.py", line 593, in get return self.request( File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\niquests\sessions.py", line 539, in request resp = self.send(prep, **send_kwargs) File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\niquests\sessions.py", line 1174, in send r = adapter.send(request, **kwargs) File "C:\Users\Plathera\AppData\Local\Programs\Python\Python310\lib\site-packages\niquests\adapters.py", line 960, in send raise ReadTimeout(e, request=request) niquests.exceptions.ReadTimeout: HTTPSConnectionPool(host='2ch.hk', port=443): Read timed out. (read timeout=10)
- Assistant