简体   繁体   English

在python中curl -u等效

[英]curl -u equivalent in python

I'm trying to download a file from a website which requires log-in. 我正在尝试从需要登录的网站下载文件。 By command line it can easily be done via 通过命令行,它可以很容易地通过

curl --proxy-anyauth -p -c cookie -u user:psw -L url > file.ext

Any advices on how to do that in python? 有关如何在python中执行此操作的任何建议? Thank you 谢谢

I have never used this before however I think this could work. 我之前从未使用过这个,但我认为这可行。
Here is the link to PyCurl library 这是PyCurl库的链接

http://pycurl.sourceforge.net http://pycurl.sourceforge.net

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM