【发布时间】:2020-06-08 12:36:53
【问题描述】:
我正在使用 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')))
【问题讨论】:
标签: proxy http-proxy socks scopus pybliometrics