且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

通过 pandas 访问远程URL时处理HTTP身份验证

更新时间:2023-02-26 13:01:37

无法测试,但是看起来基本的访问身份验证可以在url中进行编码.来自***:

Not able to test, but it looks like basic access authentication can be encoded within the url. From wikipedia:

URL编码

在访问基本访问身份验证时,客户端可以通过在URL中的主机名前添加username:password @来避免登录提示.例如,以下内容将使用安全的HTTPS协议访问网站www.example.com上的页面index.html,并通过基本授权提供用户名Aladdin和密码OpenSesame凭据: https://Aladdin:OpenSesame@www.example.com/index.html

A client may avoid a login prompt when accessing a basic access authentication by prepending username:password@ to the hostname in the url. For example, the following would access the page index.html at the web site www.example.com with the secure HTTPS protocol and provide the username Aladdin and the password OpenSesame credentials via basic authorization: https://Aladdin:OpenSesame@www.example.com/index.html

希望有帮助!