Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSL Certificate error fix? #33

Open
ma26yank opened this issue Mar 8, 2022 · 1 comment
Open

SSL Certificate error fix? #33

ma26yank opened this issue Mar 8, 2022 · 1 comment
Milestone

Comments

@ma26yank
Copy link

ma26yank commented Mar 8, 2022

I was testing this package for a web crawler I was building. But at times it gives below error. Is there any argument I have to pass or is this a bug?

_IndexWebsiteSitemap(url=https://www.crummy.com/, sub_sitemaps=[InvalidSitemap(url=https://www.crummy.com/robots.txt, reason=Unable to fetch sitemap from https://www.crummy.com/robots.txt: HTTPSConnectionPool(host='www.crummy.com', port=443): Max retries exceeded with url: /robots.txt (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (ssl.c:1131)'))))])

what I am trying is:

from usp.tree import sitemap_tree_for_homepage
tree = sitemap_tree_for_homepage("https://www.crummy.com")
print(tree)
@japherwocky
Copy link

japherwocky commented Dec 22, 2022

You can subclass your own RequestsWebClient, and in particular in the get method use requests.get( ... , verify=False)

Then do something like sitemap_tree_for_homepage('https://www.crummy.com', web_client=MyClient())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants