[Tutor] getting a webpage via python

Kent Johnson kent37 at tds.net
Wed Mar 9 14:29:46 CET 2005

Kent Johnson wrote:
> Paul Tremblay wrote:
>> So I just make a file called /etc/router_passwords  and include
>> something like
>> WRT54G username password
>> Then parse the file, and supply the info to the password handler? This
>> is easy to do, and I guess it is secure. 

The book "Foundations of Python Network Programming" has a sample program that uses a custom 
urllib2.HTTPPasswordMgr to ask the user for the username and password, maybe you would like to use that?

The examples can be downloaded from the book Web site at

Look for the one called dump_info_auth.py


More information about the Tutor mailing list