Это мой код
import bs4
import requests
res = requests.get('https://www.anywebsite.com/home')
soup = bs4.BeautifulSoup(res.text, 'json')
table_body=soup.find('tbody')
rows = table_body.find_all('tr')
for row in rows:
cols=row.find_all('td')
cols=[x.text.strip() for x in cols]
print (cols)
, и я получаю следующие ошибки:
File "C:\Users\ahsan\Anaconda3\lib\site-packages\requests\adapters.py", line 449, in send
timeout=timeout
File "C:\Users\ahsan\Anaconda3\lib\site-packages\urllib3\connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "C:\Users\ahsan\Anaconda3\lib\site-packages\urllib3\util\retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.anywebsite.info', port=443): Max retries exceeded with url: /data/ (Caused by SSLError("Can't connect to HTTPS URL
because the SSL module is not available."))
Во время обработки вышеуказанного исключения произошло другое исключение:
Traceback (most recent call last):
File "c:/Users/ahsan/Desktop/python_work/data.py", line 3, in <module>
res = requests.get('https://www.anywebsit.com/home')
File "C:\Users\ahsan\Anaconda3\lib\site-packages\requests\api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "C:\Users\ahsan\Anaconda3\lib\site-packages\requests\api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\ahsan\Anaconda3\lib\site-packages\requests\sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\ahsan\Anaconda3\lib\site-packages\requests\sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "C:\Users\ahsan\Anaconda3\lib\site-packages\requests\adapters.py", line 514, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='www.anywebsite.info', port=443): Max retries exceeded with url: /data/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
Пожалуйста, помогите мне решить эту проблему
Заранее спасибо