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

HTTP Error 403 and 418 on add_url in paper-qa #302

Closed
janki-vaghasiya opened this issue Jul 9, 2024 · 1 comment
Closed

HTTP Error 403 and 418 on add_url in paper-qa #302

janki-vaghasiya opened this issue Jul 9, 2024 · 1 comment

Comments

@janki-vaghasiya
Copy link

When I try to add url in Doc, it gives me 403 and 418 for some URLs even though they are publicly available.

My code

docs = Docs(llm=llm_client)
for url in urls:
    try:
        docs.add_url(url)
    except Exception as e:
        print(f'Exception in adding URL {url}: {e}')

Examples for failed cases:
403 Forbidden Error:

418 Unknown Error:

Can someone kindly explain why is it happening for a few URLs but for others it works fine?

@janki-vaghasiya janki-vaghasiya changed the title HTTP Error 403 and 418 on add_url HTTP Error 403 and 418 on add_url in paper-qa Jul 9, 2024
@whitead
Copy link
Collaborator

whitead commented Sep 11, 2024

Many websites, especially publishers, will block requests that look like they arise from non-users (e.g., Python). You're seeing that here. You can try to research scraping to get the URLs in an automated way or you can just download them manually first and then use paths

@whitead whitead closed this as completed Sep 11, 2024
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

2 participants