开发者

Automate file download from http using python

开发者 https://www.devze.com 2022-12-20 04:57 出处:网络
I want to automatically save a file from a website. I don\'t know how to bypass the Download File prompt in python and 开发者_开发知识库save it directly to my c: drive.

I want to automatically save a file from a website. I don't know how to bypass the Download File prompt in python and 开发者_开发知识库save it directly to my c: drive.

Any help is appreciated, Elliott


Modules like urllib2 and urlgrabber don't have a "Download File" prompt.


One idea is to use a module like mechanize to automate the query and the download. Here you can find some documentation.

  • Usually when you post a question here at stackoverflow, it is a good idea to post an example at how you have tried to solve the problem, and then we will help you to improve it, rather than asking people to write the solution for you,
  • when you use mechanize, configure the UserAgent properly and respect the policy of the webmasters about scraping.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号