pybliometrics-dev / pybliometrics

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

Scopus connectivity failing via API #265

Closed Biotopp closed 1 year ago

Biotopp commented 1 year ago

Please, could you fix the problem, it doesn't work for me any more ... Screenshot_scopus

Michael-E-Rose commented 1 year ago

Could you please file a proper report? Hints at https://medium.com/nyc-planning-digital/writing-a-proper-github-issue-97427d62a20f

Biotopp commented 1 year ago

First of all, thank you so much for your efforts ... I followed step by step the documentation to extract information, eg. :

>>> from pybliometrics.scopus import AbstractRetrieval
>>> ab = AbstractRetrieval("10.1016/j.softx.2019.100263")
>>> ab.title

But I get this error

Traceback (most recent call last):
  File "C:/Users/Science/Downloads/Test scholarly/Scopus.py", line 2, in <module>
    ab = AbstractRetrieval("10.1016/j.softx.2019.100263")
  File "C:\Users\Science\AppData\Local\Programs\Python\Python37\lib\site-packages\pybliometrics\scopus\abstract_retrieval.py", line 704, in __init__
    api='AbstractRetrieval', **kwds)
  File "C:\Users\Science\AppData\Local\Programs\Python\Python37\lib\site-packages\pybliometrics\scopus\superclasses\retrieval.py", line 48, in __init__
    Base.__init__(self, params=params, url=url, api=api)
  File "C:\Users\Science\AppData\Local\Programs\Python\Python37\lib\site-packages\pybliometrics\scopus\superclasses\base.py", line 59, in __init__
    resp = get_content(url, api, params, *args, **kwds)
  File "C:\Users\Science\AppData\Local\Programs\Python\Python37\lib\site-packages\pybliometrics\scopus\utils\get_content.py", line 111, in get_content
    raise errors[resp.status_code](reason)
pybliometrics.scopus.exception.Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource
Process finished with exit code 1

I hope I made it clear now, and thank you again!

Michael-E-Rose commented 1 year ago

From https://pybliometrics.readthedocs.io/en/stable/access.html#error-messages:

pybliometrics.scopus.exception.Scopus401Error: UNAUTHORIZED Either the provided key is not correct, in which case you should change it in ~/.pybliometrics/config.ini, or you are outside the network that provides you access to the Scopus database (e.g. your university network). Remember that you need both to access Scopus.

Also, you need the right access environment, see https://pybliometrics.readthedocs.io/en/stable/access.html.

Biotopp commented 1 year ago

I already work fine with my Scopus account and used the generated API keys in this test. So, I don't know it doesn't work!

Michael-E-Rose commented 1 year ago

Well, I can't say anything about connectivity issues. That's not the domain of pybliometrics. Do you still get to see results on scopus.com?

Biotopp commented 1 year ago

Yes, I still get result from Scopus. It works good. Unfortunately, I'm getting the same error with Pybliometrics ...

nothingcomeseasy commented 1 year ago

Yes, I still get result from Scopus. It works good. Unfortunately, I'm getting the same error with Pybliometrics ...

Hey @Biotopp

If your config.ini is correct, you should try to access the API under the IP (or VPN) of your University/Institution, then it might work.

Don't hesitate to ask.