Problem with mechanize redirect

Shashwat Anand anand.shashwat at
Sat Oct 16 09:41:42 CEST 2010

I was trying some sort of timed programming challenges which require getting
the value from url and auto-posting.
Here is what I was doing -

Here is the content :
In order to complete Programming Challenge 10, you must code a script that
will search the moo directory, and all subdirectories for the three
passwords below. Once complete, you must submit the folder number that goes
with each password (the folder that the password was found in).
Example: 1:e92nb0s4; 50:un2r9nw7; 100:48bn20b6

Then three _random_ passwords are generated.  So far so good.  I did wrote a
code using mechanize to do this.
Here is the Code :

The issue is br (i.e. mechanize.Browser instance) opens the page, fetches
data, crawl gets the solution, but when it comes back, sort of
refresh behavior is emulated.  Refresh changes the original strings.  Can't
I simply 'submit'.  When I simply try to submit, since it is on
targeturl/foo/ , it doesn't get any form as the form is on target url.

Any ideas/suggestions/hints.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list