[Tutor] getting a webpage via python

Paul Tremblay phthenry at iglou.com
Tue Mar 8 17:21:29 CET 2005

Is there a simple way to get a web page with python? I have done no
network programming with python before. 

My router (a Linksys 54G model) stores the IP/MAC addresss in a web
page. There is no way for me to access them except through the web. 

Righ now, I am using this code:

command = 'lynx -reload -auth %s:%s -source http://%s/DHCPTable.asp > %s' % (
             self.__log_name, self.__log_password, self.__router_address, temp_out1)
(exit_status, out_text) = commands.getstatusoutput(command)

The lynx terminal browser dumps the raw HTML page to the out_text, and I
can then parse it.

I would like to make the code independent of lynx, if possible.




*Paul Tremblay         *
*phthenry at iglou.com    *

More information about the Tutor mailing list