Привет, я пытаюсь использовать другой прокси для очистки этого [веб-сайта] [1], но я продолжаю получать ошибки.
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)
И это ошибка, я получение:
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