scholarly-python-package / scholarly

Retrieve author and publication information from Google Scholar in a friendly, Pythonic way without having to worry about CAPTCHAs!
https://scholarly.readthedocs.io/
The Unlicense
1.29k stars 292 forks source link

using 'search_pubs()' as stated in the docs raises a StopIteration Error #541

Open elliotchung opened 2 weeks ago

elliotchung commented 2 weeks ago

Describe the bug using 'search_pubs()' as stated in the docs raises a StopIteration Error i think another commenter in #517 mentioned a possible cause of the error:

To Reproduce

search_query = scholarly.search_pubs('Perception of physical stability and center of mass of 3D objects')
scholarly.pprint(next(search_query))
---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
Cell In[15], line 1
----> 1 scholarly.pprint(next(search_query))

File ~\miniconda3\Lib\site-packages\scholarly\publication_parser.py:93, in _SearchScholarIterator.__next__(self)
     91     return self.__next__()
     92 else:
---> 93     raise StopIteration

StopIteration:

Expected behavior Returns the single search result of this publication

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Do you plan on contributing? No

keko24 commented 2 weeks ago

Hey, I am currently working on a fix, but in the mean time search_single_pub works properly for this case.

keko24 commented 3 days ago

Hey, this was fixed so it should be closed.