I would like to login to a certain web page, and download few pages as logged in user. I think I theoretically know what to do, based on an answer to this stackoverflow question, but I have no idea, where in the address should I put the login credentials. In the question above, it is quite obvious, but it is not so obvious at Aukro.
I’d be very grateful for any avice… 🙂
I would like to login to a certain web page , and download few
Share
One tricky part is the fact that this login page sets a bunch of session cookies and appends some unique query string parameters for your session. Presumably, you’ll need to retrieve good values from the server for each session you create.
When you land on https://ssl.aukro.cz/enter_login.php, you get a 302 Found (which in practice is used for redirects). The full request looks like this:
You’ll need to grab the URL location and the cookie it sets (“ws2”). Then you’ll need to drop onto that redirect URL you grabbed, and get the rest of the cookies it sets, which are
ws2,stsd_refr, andqeppo_login.You then need to fill in the POST body with the form elements as mentioned above and in the links you provided.
Not knowing anything about this site you’re trying to log into, I’d venture a guess that if you don’t get good session variables and cookies and include them for each of your logical requests, your login attempts may fail.
Long story short, just use Fiddler or Firebug to capture what a login session looks like, and mimic it using the techniques you’ve already seen.