I'm trying to log into a site with my credentials, using cookies I assume, though I'm new to using proper web id's and posting. I'm simply trying to log in to http://www.zulutrade.comI am building a script that will feed and analyze my own trade info, but need to be able to login and have the cookie so the site will remember my python script for the duration it's running. Similar to a browser experience, but I want to do it with urllib/urllib2.

As you can see with 'outputData.txt' that is created, it simply prints out the html of the login page again. Yes I have emitted my username and password for obvious reasons, but if the login was done correctly, the outputData.txt would show html for 'incorrect username/password'...What am I doing wrong here?? I'm trying to capture the cookie as well, which I think I'm doing right.Please help:(David

Hi, I was advised to use Mechanize Module to login to a website via python script, though I originally wanted to use urllib/urllib2. Now, I've read the docs for Mechanize and it just isn't working. I have cookie support added to my script, and it seems Mechanize just won't do the job. Can someone take a look at my code and tell me if I'm missing something? The OUTPUT my script creates (MechanizeDat.html) should show the page once I'm logged in, which should include my username and account etc, ... though it currently just shows the login screen all over again. For obvious reasons, I'm emitting my password/username from the script, but you will get the idea (you should get a 'wrong username/passowrd combination' but you will see you just get the log in screen):

I have researched Mechanize, sorry I thought it was a python-run browser, I'm a noob. Anyways, I've tried it out and it's not working, in the same way urllib/urllib2 wasn't working.. can you take a look at my code? I've emitted the password/username but if it works the output file should show a page that states 'wrong username/password' as opposed to just bringing up the login page again. I've tried all id and name tags I could find in the source of the zulutrade page, it's just not working.