Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
570 views
in Technique[技术] by (71.8m points)

python-requests - 使用python请求和凭据下载hub.bianquis.org文件(Download hub.bianquis.org files with python requests and credentials)

I'm trying to download some pdf files from hub.bianquis.org where I have a valid account giving me access to documents whose I know the adresses (eg https://hub.bianquis.org/user/my_username/files/donnees/sup/cours/cours_piles.pdf )

(我正在尝试从hub.bianquis.org下载一些pdf文件,在那里我有一个有效的帐户,可以访问我知道地址的文档(例如https://hub.bianquis.org/user/my_username/files/donnees/sup/cours/cours_piles.pdf ))

I have tried to download the pdfs with the Python Requests module by using very basic commands in Python.

(我试图通过使用Python中的非常基本的命令来下载带有Python Requests模块的pdf。)

I have also tried to use the advice given on this page: Python requests with login credentials but it didn't work, I get at most a 405 (method not allowed) error.

(我也尝试使用此页面上提供的建议: 具有登录凭据的Python请求,但是它不起作用,我最多收到405(不允许的方法)错误。)

I have proper access to the files normally on my web browser but I wish I could automate the downloads with python for archiving purposes (I have the list of these urls).

(我通常可以在Web浏览器上正常访问文件,但希望可以使用python自动下载以进行存档(我有这些url的列表)。)

I should mention I am not familiar with all HTML features, neither with the programming background that is sometimes explained in the documentations of Requests and network programming, but I know python well enough to automate the process once I find a way to get the Requests module working.

(我应该提一下,我并不熟悉所有HTML功能,也不熟悉有时会在请求和网络编程文档中说明的编程背景,但是一旦我找到一种获取请求模块的方法,我就充分了解python可以自动完成该过程。工作。)

Thank you very much.

(非常感谢你。)

  ask by L'esprit d'Eloi translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...