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.37k stars 298 forks source link

Invalid Bibtex comes back with 200 status code, causing parsing errors #270

Open ipeirotis opened 3 years ago

ipeirotis commented 3 years ago

Look at the case described at https://github.com/scholarly-python-package/scholarly/issues/268#issuecomment-790944970 and https://github.com/scholarly-python-package/scholarly/issues/268#issuecomment-800994100

jenschne commented 3 years ago

Is this related to the following as well?

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-16-cda3ef06fbcb> in <module>()
      6 scholarly.fill(publications[0],[])
      7 scholarly.pprint(publications[0])
----> 8 scholarly.bibtex(publications[0])
      9 copublications = coauthor['publications']
     10 scholarly.pprint(copublications[4])

5 frames
/usr/local/lib/python3.7/dist-packages/bibtexparser/bwriter.py in _entry_to_bibtex(self, entry)
    117         bibtex = ''
    118         # Write BibTeX key
--> 119         bibtex += '@' + entry['ENTRYTYPE'] + '{' + entry['ID']
    120 
    121         # create display_order of fields for this entry

KeyError: 'ENTRYTYPE'
gabrielctn commented 2 years ago

Is this related to the following as well?

---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
<ipython-input-16-cda3ef06fbcb> in <module>()
      6 scholarly.fill(publications[0],[])
      7 scholarly.pprint(publications[0])
----> 8 scholarly.bibtex(publications[0])
      9 copublications = coauthor['publications']
     10 scholarly.pprint(copublications[4])

5 frames
/usr/local/lib/python3.7/dist-packages/bibtexparser/bwriter.py in _entry_to_bibtex(self, entry)
    117         bibtex = ''
    118         # Write BibTeX key
--> 119         bibtex += '@' + entry['ENTRYTYPE'] + '{' + entry['ID']
    120 
    121         # create display_order of fields for this entry

KeyError: 'ENTRYTYPE'

I got the same issue as well, any news about this ?