Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Max retries exceeded with url error while running the code?

I write this code to scrap this particular page but it constantly gave

error "requests.exceptions.SSLError: HTTPSConnectionPool(host='rcms.assam.gov.in', port=443): Max retries exceeded with url: /Show_Reports.aspx?RID=86 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))"

import requests
from bs4 import BeautifulSoup as bs


url = "https://rcms.assam.gov.in/Show_Reports.aspx?RID=86"
page = requests.get(url)
soup = bs(page.text,"lxml")
like image 285
Deepak singh Avatar asked Sep 03 '26 17:09

Deepak singh


2 Answers

At your own risk you can do this:

page = requests.get(url, verify=False)
like image 141
Ramrab Avatar answered Sep 06 '26 07:09

Ramrab


Download the website certificate to your local computer, and then

page = requests.get(url, verify="path to certificate")
like image 40
Neil Avatar answered Sep 06 '26 08:09

Neil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!