zhiyzuo / python-scopus

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

Quick Start example on .retrieve_citation() not working #6

Closed Michael-E-Rose closed 7 years ago

Michael-E-Rose commented 7 years ago

I use a working Scopus key in variable KEY which is enabled for the Citation Overview API. Trying to reproduce the Quick Start example I get the following error message:

>>> scopus = Scopus(KEY)
>>> pub_citations = scopus.retrieve_citation('84905286162')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pyscopus/scopus.py", line 306, in retrieve_citation
    soup = bs(urlopen(citation_url).read(), 'lxml')
  File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 410, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 523, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 448, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 382, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 531, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
zhiyzuo commented 7 years ago

Thank you for bringing this up.

As stated in the quick start page,

Please note that if you are searching the citation record for only one publication, you still need to put it in a list or numpy array.

So please try to put the scopus id in a list like this: ['84905286162'] and see if that works. My api keys are expired now and cannot test this feature at this moment.

Michael-E-Rose commented 7 years ago

Ah yes, that's how it works. I was reading it but then felt to simply repeat the example. You should maybe update the quick start page.

zhiyzuo commented 7 years ago

fixed quick start page