Occasionally, I will fail to get a send/receive a request with this GroupMe API wrapper. I can catch the Exception raised, but I still get a lengthy traceback, despite the program continuing to run. Full traceback:
could not recieve a response
Traceback (most recent call last):
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 137, in _new_conn
(self.host, self.port), self.timeout, **extra_kw)
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\util\connection.py", line 67, in create_connection
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
File "E:\Users\Sebastian\Anaconda3\lib\socket.py", line 743, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 559, in urlopen
body=body, headers=headers)
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 345, in _make_request
self._validate_conn(conn)
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 784, in _validate_conn
conn.connect()
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 217, in connect
conn = self._new_conn()
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connection.py", line 146, in _new_conn
self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002CD65CF60F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\adapters.py", line 376, in send
timeout=timeout
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\connectionpool.py", line 609, in urlopen
_stacktrace=sys.exc_info()[2])
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\packages\urllib3\util\retry.py", line 273, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
requests.packages.urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.groupme.com', port=443): Max retries exceeded with url: /v3/chats?token=98d6c1109f660135d705089a21c58196 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002CD65CF60F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\groupy\session.py", line 25, in request
response = super().request(*args, **kwargs)
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "E:\Users\Sebastian\Anaconda3\lib\site-packages\requests\adapters.py", line 437, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.groupme.com', port=443): Max retries exceeded with url: /v3/chats?token=98d6c1109f660135d705089a21c58196 (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x000002CD65CF60F0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
I find it particularly interesting that it starts with "could not recieve a response" (misspelling included) before the Traceback, but I cannot for the life of me find where that line is. It certainly isn't in my code, nor the code of the groupy module.
Don't trust the search feature on Github
Despite searching "recieve" on the repo, only a different occurrence of it showed up. However, the problem was in session.py, where an Exception was both logged and raised.
Related
I suspected that an endpoint I have times out every so often, so I created a python script that sends a request on loop every 30 seconds and prints the responses it receives:
if __name__ == '__main__':
counter = 0
while True:
res = requests.post(url, payload)
try:
response = res.json()
except json.JSONDecodeError:
response = res.text
print(response)
if res.status_code != 201:
break
time.sleep(30)
print(res)
print(dir(res))
print(res.status_code)
print(response)
The script eventually failed with the following traceback:
{'success': True, 'created_on': '2022-09-08 22:42'} # --- 201 response
{'success': True, 'created_on': '2022-09-08 22:43'} # --- 201 response
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\socket.py", line 953, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 353, in connect
conn = self._new_conn()
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001F5485BB9A0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='url', port=443): Max retries exceeded with url: /new_lead/5kbLWVNXHQ3U6lJ9trME8hPSf (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001F5485BB9A0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\dev\pythonProject\main.py", line 13, in <module>
res = requests.post(
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='url', port=443): Max retries exceeded with url: /new_lead/5kbLWVNXHQ3U6lJ9trME8hPSf (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001F5485BB9A0>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed'))
but now I'm a bit confused as to what this means. If it was the server timing out, wouldn't it give a 500 response and the script would have broke out of the while loop and tried to print the response objects? Does this mean that my internet connection dropped and the script was unable to make the request because the pc wasn't connected to the internet?
From the first traceback:
socket.gaierror: [Errno 11004] getaddrinfo failed
your DNS lookup failed. While that exception was being handled, all the other stuff failed, but that's the underlying problem.
I've searched high and low and can't find a fix that seems to fit my use case. I've had some Python3 install issues on my M1 mac but think it's now running okay.
Just trying to learn / work with the requests library, but when I try to run this very simple python code:
import requests
response = requests.get("https://api.open-notify.org/this-api-doesnt-exist")
print(response.status_code)
I get the below error...
Any advice on how to fix this? I'm pulling my hair out.
Thank you!
/Users/myname/venv/python310/bin/python /Users/myname/Documents/2022_api/api01.py
Traceback (most recent call last):
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connection.py", line 174, in _new_conn
conn = connection.create_connection(
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/util/connection.py", line 95, in create_connection
raise err
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/util/connection.py", line 85, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 703, in urlopen
httplib_response = self._make_request(
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 1040, in _validate_conn
conn.connect()
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connection.py", line 358, in connect
conn = self._new_conn()
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connection.py", line 186, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x10f5a0850>: Failed to establish a new connection: [Errno 61] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myname/venv/python310/lib/python3.10/site-packages/requests/adapters.py", line 440, in send
resp = conn.urlopen(
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/connectionpool.py", line 785, in urlopen
retries = retries.increment(
File "/Users/myname/venv/python310/lib/python3.10/site-packages/urllib3/util/retry.py", line 592, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.open-notify.org', port=443): Max retries exceeded with url: /this-api-doesnt-exist (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10f5a0850>: Failed to establish a new connection: [Errno 61] Connection refused'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/myname/Documents/2022_api/api01.py", line 3, in <module>
response = requests.get("https://api.open-notify.org/this-api-doesnt-exist")
File "/Users/myname/venv/python310/lib/python3.10/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/Users/myname/venv/python310/lib/python3.10/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/myname/venv/python310/lib/python3.10/site-packages/requests/sessions.py", line 529, in request
resp = self.send(prep, **send_kwargs)
File "/Users/myname/venv/python310/lib/python3.10/site-packages/requests/sessions.py", line 645, in send
r = adapter.send(request, **kwargs)
File "/Users/myname/venv/python310/lib/python3.10/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='api.open-notify.org', port=443): Max retries exceeded with url: /this-api-doesnt-exist (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x10f5a0850>: Failed to establish a new connection: [Errno 61] Connection refused'))
Process finished with exit code 1
Connection Refused means that the host (api.open-notify.org) is not listening on the port (https is on port 443) in your request.
I tried connecting to port 80 (plain http) instead and that worked for me:
>>> response = requests.get("http://api.open-notify.org/this-api-doesnt-exist")
>>> print(response.status_code)
404
For laughs, I tried connecting to the base url
>>> response = requests.get("http://api.open-notify.org")
>>> print(response.status_code)
500
>>> response
<Response [500]>
>>> response.text
'<html>\r\n<head><title>500 Internal Server Error</title></head>\r\n<body bgcolor="white">\r\n<center><h1>500 Internal Server Error</h1></center>\r\n<hr><center>nginx/1.10.3</center>\r\n</body>\r\n</html>\r\n'
I was trying to run this code:
import requests
r = requests.get("https://upos-sz-mirrorkodo.bilivideoo1.com/")
But a BIG ERROR has raised.
Traceback (most recent call last):
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "C:\Users\王子涵\AppData\Local\Programs\Python\Python38\lib\socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connection.py", line 353, in connect
conn = self._new_conn()
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000026E92F17F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "E:\Programming\Python\VSC\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "E:\Programming\Python\VSC\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='upos-sz-mirrorkodo.bilivideoo1.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000026E92F17F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "e:\Desktop\1.py", line 48, in <module>
r = get(
File "E:\Programming\Python\VSC\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "E:\Programming\Python\VSC\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "E:\Programming\Python\VSC\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "E:\Programming\Python\VSC\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "E:\Programming\Python\VSC\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='upos-sz-mirrorkodo.bilivideoo1.com', port=443): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000026E92F17F40>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed'))
I tried to ping this host but failed, and Google didn't give useful advice.
Could you please tell me why and how to deal with it? Thanks a lot.
I have also asked this question on Github at https://github.com/psf/requests/issues/6010.
This error indicates that the URL you specified is simply not reachable. You said yourself that you cannot ping the host. Therefore, this issue is not related to your code. If you try requests.get("https://www.google.com/") it will probably work fine.
Update: Some comments pointed out that you might have a typo in your URL and that you meant to type:
upos-sz-mirrorkodo.bilivideo.com
I am very green to this process so please bear with me. I am in a Computer Science class where we have to run python code from the command line to extract tweets from Twitter. I ran the provided code and the program ran for about 30 minutes and just stopped on its own and gave an error which I didn't capture at the time. I closed out the command screen and restated the process. It no longer runs and just spits out the following error. I have no idea what any of this means so I am not sure what to do to resolve it. I tried rebooting and starting again, but I am getting thee same error. Please if anyone can help. here is the error it is displaying.
Microsoft Windows [Version 10.0.19043.1165]
(c) Microsoft Corporation. All rights reserved.
C:\Users\Christy>cd "C:\Users\Christy\CSE 632"
C:\Users\Christy\CSE 632>python tweets.py
Traceback (most recent call last):
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\connection.py", line 96, in create_connection
raise err
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\connection.py", line 86, in create_connection
sock.connect(sa)
TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 1010, in _validate_conn
conn.connect()
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 353, in connect
conn = self._new_conn()
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x0000013B04320E50>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='stream.twitter.com', port=443): Max retries exceeded with url: /1.1/statuses/filter.json?delimited=length (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000013B04320E50>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\Christy\CSE 632\tweets.py", line 32, in <module>
stream.filter(track=['Gamestop', 'Robinhood', 'purchase', 'block'])
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\tweepy\streaming.py", line 474, in filter
self._start(is_async)
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\tweepy\streaming.py", line 389, in _start
self._run()
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\tweepy\streaming.py", line 320, in _run
six.reraise(*exc_info)
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\six.py", line 719, in reraise
raise value
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\tweepy\streaming.py", line 266, in _run
resp = self.session.request('POST',
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\Christy\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='stream.twitter.com', port=443): Max retries exceeded with url: /1.1/statuses/filter.json?delimited=length (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x0000013B04320E50>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond'))
C:\Users\Christy\CSE 632>
Hi i'm trying to use different proxy to scrape this [website][1],
But i'm keep getting errors.
import requests
from bs4 import BeautifulSoup
import pandas as pd
import urllib3
url2= 'https://forecast.weather.gov/MapClick.php?lat=33.96746500000006&lon=-118.25679999999994#.XphNUsgzaUk'
proxies1 = {
"https": "https://209.220.97.131:8080",
"http": "http://209.220.97.131:8080"
}
page = requests.get(url2, proxies=proxies1, verify=False)
And this is the error i'm getting:
C:\Users\USER\PycharmProjects\untitled\venv\Scripts\python.exe "C:/Users/USER/PycharmProjects/Scraper/Clever scraper.py"
Traceback (most recent call last):
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connection.py", line 160, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\util\connection.py", line 84, in create_connection
raise err
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\util\connection.py", line 74, in create_connection
sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py", line 667, in urlopen
self._prepare_proxy(conn)
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py", line 930, in _prepare_proxy
conn.connect()
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connection.py", line 308, in connect
conn = self._new_conn()
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connection.py", line 172, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x000001BED2B7E388>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\connectionpool.py", line 725, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\urllib3\util\retry.py", line 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='forecast.weather.gov', port=443): Max retries exceeded with url: /MapClick.php?lat=33.96746500000006&lon=-118.25679999999994 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001BED2B7E388>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/USER/PycharmProjects/Scraper/Clever scraper.py", line 17, in <module>
page = requests.get(url2, proxies=proxies1, verify=False)
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\requests\api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\requests\sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\requests\sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "C:\Users\USER\PycharmProjects\untitled\venv\lib\site-packages\requests\adapters.py", line 510, in send
raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='forecast.weather.gov', port=443): Max retries exceeded with url: /MapClick.php?lat=33.96746500000006&lon=-118.25679999999994 (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x000001BED2B7E388>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it')))
Process finished with exit code 1