Mechanoid Web Browser - Recording Capability

John J. Lee jjl at pobox.com
Sat Sep 16 20:21:49 EDT 2006


"Seymour" <seymour.morris at gmail.com> writes:
[...]
> struggling otherwise and have been trying to learn how to program the
> Mechanoid module (http://cheeseshop.python.org/pypi/mechanoid) to get
> past the password protected site hurdle.
> 
> My questions are:
> 1. Is there an easier way to grab these pages from a password protected
> site, or is the use of Mechanoid a reasonable approach?
[...]

Again, can't speak for mechanoid, but it should be straightforward
with mechanize (simplifiying one of the examples from the URL below):


http://wwwsearch.sourceforge.net/mechanize/

br = Browser()
br.add_password("http://example.com/protected/", "joe", "password")
br.set_debug_http(True)  # Print HTTP headers.
br.open("http://www.example.com/protected/blah.html")
print br.response().read()


John



More information about the Python-list mailing list