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

[BUG]: 'arxiv' search result is unexpectedly empty #56

Closed
timsanders256 opened this issue May 17, 2024 · 7 comments
Closed

[BUG]: 'arxiv' search result is unexpectedly empty #56

timsanders256 opened this issue May 17, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@timsanders256
Copy link
Collaborator

timsanders256 commented May 17, 2024

Description of the bug

data = kb.get_data(10, "Machine Learning") sometimes returns a empty dictionary. After testing the arxiv module I found that when requesting frequently, it would return a empty search result. The reason might be found at issue #129 of arxiv:

liyucheng09 commented Oct 17, 2023
I tried about 300 attempts hourly today. More than 3000 in total. 0 out of 3000 suceeded.
By sending a user-agent to the feedparser, 28 out of 100 suceeded.
I suppose we could safely say arxiv is declining requests from programmatic clients.

So it should not be our problem.

Steps To Reproduce

No response

Additional Information

No response

@timsanders256 timsanders256 added the bug Something isn't working label May 17, 2024
@timsanders256
Copy link
Collaborator Author

Or we might inherit the Client class, and alter line #660

resp = self._session.get(url, headers={"user-agent": "arxiv.py/2.1.0"})

to pretend to be a browser.

@lwaekfjlk
Copy link
Member

nice finding @timsanders256 ! Can we add a pytest function to test get_data and make sure it can alwasy return something?

@timsanders256
Copy link
Collaborator Author

Yes, that would be a great idea.

@lwaekfjlk
Copy link
Member

Could you create a PR for this issue? @timsanders256

@ft2023
Copy link
Collaborator

ft2023 commented May 24, 2024

I feel weird. Did you test it locally? Network issues? (vpn) That didn't happen on my side of the test. In addition, we may not call this function too often in real usage.

@lwaekfjlk
Copy link
Member

This issue would be fixed once #59 is fixed.

@lwaekfjlk lwaekfjlk reopened this May 27, 2024
@lwaekfjlk
Copy link
Member

arxiv only calls once now. abort this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants