6

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")

3 Answers 3

10

At your own risk you can do this:

page = requests.get(url, verify=False)
Sign up to request clarification or add additional context in comments.

5 Comments

InsecureRequestWarning: Unverified HTTPS request is being made to host 'rcms.assam.gov.in'. Adding certificate verification is strongly advised. See: urllib3.readthedocs.io/en/1.26.x/… warnings.warn(
it gave this error
That is not an error. It's a warning
so how can i resolve that so i can scrap data from that page
You can disable the warning with urllib3.disable_warnings() However, that's the least of your worries. You're going to have to figure out how to bypass the Captcha
1

Download the website certificate to your local computer, and then

page = requests.get(url, verify="path to certificate")

1 Comment

And how would one go about downloading the website certificate?
1

As said by Fred, do it at your own risk. To disable the warning along with verify=False use the below code.

from urllib3.exceptions import InsecureRequestWarning
from urllib3 import disable_warnings

disable_warnings(InsecureRequestWarning)

page = requests.get(url, verify=False)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.