I'm trying to submit form protected with captcha via python bot (using mechanize library). Let's say i have 2 pages form.php and captcha.php. I grab the captcha image from captcha.php and manually solve it. But because captcha changes every reload, submitting fails because image retrieved from captcha.php isn't same as one in opened page where form is. I found 2 possible solutions to save cookies from captcha.php and save it to browser instance of mechanize class and some vb.net solution where captcha.php is inserted in instance of webbrowser which opened form.php page. I don't have a single clue how to implement this in python, and i don't see how can this solve the problem because captcha answer is stored in session variable on server. I would like appreciate any hint on how to solve this problem in python or some other language.