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

StopIteration on search query with DOI (was working a month ago) #510

Open
1 task
kostrykin opened this issue Aug 1, 2023 · 2 comments
Open
1 task

StopIteration on search query with DOI (was working a month ago) #510

kostrykin opened this issue Aug 1, 2023 · 2 comments
Labels

Comments

@kostrykin
Copy link

kostrykin commented Aug 1, 2023

Describe the bug
I get a StopIteration error immediately after calling next on a search query which contains a DOI. The same code has been working for many months, but stopped working suddenly. It appears that scholarly fails to find (or parse?) the document. The DOI used seems negligible (I have tried several others and all yield the same behavior).

To Reproduce

from scholarly import scholarly, ProxyGenerator

search_query = scholarly.search_pubs('10.1007/978-3-031-09037-0_20')
pub = next(search_query)
print(pub['num_citations'])

Expected behavior
The code should run through without errors being raised (and a 0 should be printed).

Desktop (please complete the following information):

  • python version: 3.7.13
  • OS: Ubuntu 20.04.6
  • Version: 1.7.11

Do you plan on contributing?
Your response below will clarify whether the maintainers can expect you to fix the bug you reported.

  • Yes, I will create a Pull Request with the bugfix.

Additional context
I have tried this with scholarly 1.7.9 and 1.7.11, installed via pip.

@kostrykin kostrykin added the bug label Aug 1, 2023
@kostrykin kostrykin changed the title StopIteration on search query (was working a month ago) StopIteration on search query with DOI (was working a month ago) Aug 1, 2023
@ronny3
Copy link

ronny3 commented Aug 29, 2023

Probably the same as #508 . Google Scholar have a new class in the UI for when there is a single result. I posted a simple patch while waiting for better fix.

@kostrykin
Copy link
Author

The workaround mentioned in #508 indeed works.

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

No branches or pull requests

2 participants