pybliometrics-dev / pybliometrics

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

Failed to establish a new connection #200

Closed raffaem closed 3 years ago

raffaem commented 3 years ago

I am getting this error when I try an Author Search

HTTPSConnectionPool(host='api.elsevier.com', port=443): Max retries exceeded with url: /content/search/author?count=200&view=STANDARD&query=AUTHFIRST%28diego%29+AND+AUTHLASTNAME%28bonetti%29+AND+AFFIL%28MILANO-BICOCCA%29&start=200 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd113a67f40>: Failed to establish a new connection: [Errno -2] Name or service not known'))

The relevant code is just that:

    query = f"AUTHFIRST({firstname}) AND AUTHLASTNAME({lastname}) AND AFFIL({university})"
    res = AuthorSearch(query, refresh=True)
Michael-E-Rose commented 3 years ago

That doesn't look like a problem with pybliometrics. Do the other APIs work?

raffaem commented 3 years ago

I don't know whether the other APIs work, but it's always the same problem.

If you catch the exception and sleep for 30 seconds, it starts to work again.

But the exception is thrown by requests, not by pybliometrics.

So it may be due to my unstable connection, I had also other problems with other software due to my unstable connection.

Since the problem is thrown by requests, I think we can close it (and I just remember to catch the exception)