Question

I have a python script that needs to download a csv file from:

https://myasx.asx.com.au/home/watchlist/download.do

The issue I have is you have to log in to the website first, It is Cookie based authentication (HTML form login).

So far I have looked at urllib2 and Requests and haven't had much luck.

Was it helpful?

Solution

The requests library should do what you want. You can use Session objects to persist the authentication.

To quote the request docs -

The Session object allows you to persist certain parameters across requests. It also persists cookies across all requests made from the Session instance.

Post your code if you are still experiencing problems.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top