0

I am trying to download a CSV file from a website using python 2.7. I already found some posting about how to retrieve files.

http://www.blog.pythonlibrary.org/2012/06/07/python-101-how-to-download-a-file/

How do I download a file over HTTP using Python?

However, the site that I am trying to access requires authentication: id and password. I was wondering if anyone out there might share an example of how to download a file with authentication barrier.

Community
  • 1
  • 1
Jorge Nieves
  • 1
  • 1
  • 1
  • 3
    What *kind* of authentication barrier? Cookie-based (HTML form login), or HTTP based (browser pops up a login prompt as a modal dialog)? – Martijn Pieters Dec 28 '12 at 14:08
  • [Here](http://www.voidspace.org.uk/python/articles/authentication.shtml) is a tutorial for http based authentication with python/urllib2. This wont work if the authentication is cookie based. –  Dec 28 '12 at 14:17
  • Please check it out by the [link](http://stackoverflow.com/questions/22496655/download-a-file-providing-username-and-password-using-python), in which there is an example of using request module. – Lillian Feb 03 '16 at 15:14

1 Answers1

1

You can use requests module, and its documentation.

ayyayyekokojambo
  • 1,165
  • 3
  • 13
  • 33