Browsing with Mechanize
The mechanize module in Python is similar to perl WWW:Mechanize.
It gives you a browser like object to interact with web pages.
Here is an example on how to use it in a program.
Follow second link with element text matching regular expression
To get the response code from a website, you can the response.code
Get all forms from a website
I found this post at that very accurate describes how
to emulate a browser in Python using mechanize.
Browsing with Python ( )
Google demands a user-agent that isn't a robot
Retrieve the Google home page, saving the response
Select the search box and search for 'foo'
Get the search results
Find the link to foofighters.com; why did we run a search?
Print the site
The script above is split up to make it easier to read
Register on GamerZFuRY!
Guest Message by DevFuse
[Python] Working with mechanize module-basics
No replies to this topic
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users