pybliometrics-dev / pybliometrics

Python-based API-Wrapper to access Scopus
https://pybliometrics.readthedocs.io/en/stable/
Other
401 stars 124 forks source link

AttributeError with AbstractRetrieval(..., view="REF").references #326

Closed Michael-E-Rose closed 3 months ago

Michael-E-Rose commented 4 months ago

pybliometrics version: 3.6

Code to reproduce the bug:

ab = AbstractRetrieval("2-s2.0-84958120800", view="REF")
ab.references

results in AttributeError: 'str' object has no attribute 'get' in line info = item.get('ref-info', item).

The issue is caused by a malformatted reference list (from ._ref), where the offending element is simply no dictionary. Instead the dictionary keys became list members are simple strings.

Solution: Skip item if not a dictionary.