Questions tagged [mechanize-python]

Stateful programmatic web browsing in Python, after Andy Lester’s Perl module WWW::Mechanize.

Stateful programmatic web browsing in Python, after Andy Lester’s Perl module WWW::Mechanize.

Some of the key features:

  • The browser class mechanize.Browser implements the interface of urllib2.OpenerDirector, so any URL can be opened not just http.
  • Easy HTML form filling.
  • Convenient link parsing and following.
  • Browser history (.back() and .reload() methods).
  • The Referer HTTP header is added properly (optional).
  • Automatic observance of robots.txt (can be disabled if desired).
  • Automatic handling of HTTP-Equiv and Refresh.

python-mechanize was created by John J. Lee. Maintenance was taken over by Kovid Goyal.


HomePage | Documentation | Github | FAQ


235 questions
1
vote
1 answer

Mechanize module for GAE

I tried to make the mechanize module work with GAE, but no luck. I used latest version of mechanize and the versions that are GAE specific from here Python Mechanize + GAEpython code. What I want to do is to login to a website and submit a…
pito_john
  • 57
  • 1
  • 1
  • 6
1
vote
0 answers

How to submit a form on Mechanize then submit to the next form that loads

Sorry if the title is poor. This code is copied, so I don't know what the first few lines do. The site I want to scrape first asks for the email, which after submission asks for the password. When I inspect element, the password form is loaded only…
MQStacked
  • 31
  • 3
1
vote
1 answer

File upload through python mechanize

I am trying to upload image file into the browser using mechanize. Although there is no error, the uploaded file does not reflect when I check manually in the browser (post submit/saving). I am using the following code to upload the files import…
Ash Sharma
  • 470
  • 3
  • 18
1
vote
0 answers

Extract table rows from iframe with python, mechanize and BeautifulSoup

I've been trying and looking for help like crazy, and I have not been able to solve this issue. Could you please help me on getting the table content inside the iFrame... On my code I was able to login in to the webpage and get in to the link were…
Alberto Rocha
  • 553
  • 1
  • 5
  • 16
1
vote
0 answers

How to select controls inside a table that is inside a form - mechanize?