0

我正在使用pybliometrics(Scopus API 的 Python 接口)来下载一些论文的摘要。

不幸的是,Scopus 只在订阅它的大学网络内工作。我目前在家,每当我尝试使用 pybliometrics 下载内容时,都会出现以下错误:

pybliometrics.scopus.exception.Scopus401Error: The requestor is not authorized to access the requested view or fields of the resource

我需要使用我大学的代理才能使用我大学的 IP 地址进入互联网。代理有一个可用的 WPAD 配置文件,但我没有意识到如何将它与 pybliometrics 一起使用。pybliometrics文档说要在配置文件中添加一个块,如下所示:

[Proxy]
ftp = socks5://127.0.0.1:1234
http = socks5://127.0.0.1:1234
https = socks5://127.0.0.1:1234

但是这个代理需要身份验证。如何指定代理用户名和密码?

编辑:我尝试在 config.ini 中设置块,例如:

[Proxy]
ftp = http://username:password@proxy.thing.it:8080
http = http://username:password@proxy.thing.it:8080
https = http://username:password@proxy.thing.it:8080

但它仍然失败并显示以下错误消息:

requests.exceptions.ProxyError: HTTPSConnectionPool(host='api.elsevier.com', port=443): Max retries exceeded with url: /content/abstract/scopus_id/84983158344?view=META_ABS (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 Proxy Authentication Required')))
4

3 回答 3

0

从我们的角度来看,只要代理配置正确,API 就可以通过代理工作。我建议您与代理提供商联系,看看他们是否可以提供帮助。

我们没有关于如何通过代理使用 API 的具体说明(因为有许多潜在的不同版本和潜在配置);但是,一般说明在这里:

https://service.elsevier.com/app/answers/detail/a_id/29026/supporthub/elsevieraccess/

于 2020-06-18T11:09:22.523 回答
0

对我来说,你的新代理块看起来很可疑。它也通过 http 汇集 ftp 和 https 请求。也许在相应的部分尝试 ftp 和 https 作为协议。

另一种解决方案是向 Scopus 集成支持咨询 InstToken,您可以使用它来代替代理。然后,您还要在配置文件中指定 InstToken。

于 2020-08-27T07:07:34.893 回答
0

问题是我的代理需要 DigestAuth 而不是 BasicAuth。

于 2021-12-31T00:46:50.570 回答