使用需要通过pybliometrics进行身份验证的代理

时间:2020-06-08 12:36:53

标签: proxy http-proxy socks scopus pybliometrics

我正在使用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 documentation说要在配置文件中添加一个块,如下所示:

[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')))

2 个答案:

答案 0 :(得分:0)

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

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

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

答案 1 :(得分:0)

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

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

相关问题