zhiyzuo / python-scopus

PyScopus
http://zhiyzuo.github.io/python-scopus/
MIT License
23 stars 29 forks source link

Author search error #11

Closed zhiyzuo closed 6 years ago

zhiyzuo commented 6 years ago

From stakagi@uchicago.edu:

Hi, thank you for this wonderful package. I'm pretty new at Python, and I have got a problem with "scopus.search_author" part. it worked with your sample cord, but it doesn't with some of the professors who I am trying to search of. For example for prof. Black, Dan A. (AU-ID:7402568800), the code goes like this. Is there any solution to this? Thank you in advance. >>> author_result_df = scopus.search_author("AUTHLASTNAME(Black) and AUTHFIRST(Dan)") Traceback (most recent call last): File "", line 1, in File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyscopus\scopus.py", line 103, in searchauthor return self.search(query, count, type=2, view=view) File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyscopus\scopus.py", line 63, in search result_df, total_count = _searchscopus(self.apikey, query, type, view=view) File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyscopus\utils.py", line 301, in _search_scopus result_df = pd.DataFrame([_parseentry(entry, type) for entry in entries]) File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyscopus\utils.py", line 301, in result_df = pd.DataFrame([_parseentry(entry, type) for entry in entries]) File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyscopus\utils.py", line 208, in _parse_entry return _parse_author(entry) File "C:\Program Files (x86)\Python36-32\lib\site-packages\pyscopus\utils.py", line 111, in _parse_author affil = entry['affiliation-current'] KeyError: 'affiliation-current'

zhiyzuo commented 6 years ago

Sovled with https://github.com/zhiyzuo/python-scopus/commit/aeb2f9919373b377304885503feb10f1aab27e40