Script Request...

Diez B. Roggisch deets at nospam.web.de
Wed Mar 19 07:41:23 EDT 2008


some one wrote:

> Hi all, I am not to familiar with python yet and I am wondering if
> someone can write a script that will monitor my DSL modems IP address
> and notify when it changes, its a 2Wire Advanced DSL Modem.  I need to
> know when it changes because I am trying to run my own inhouse server
> and have to update my domain records through verio.com.
> 
> The script would need to read the text of a web page( on my modem the
> address is http://192.168.0.1/xslt?PAGE=B01&THISPAGE=&NEXTPAGE=B01 ) and
> search for a string containing the IP address.
> 
> Can anyone help?
> thanks, I'll keep monitoring this thread.

Try urllib2 to fetch the data, use either string-search, regular expressions
or even BeautifulSoup to extract the data. Use a cron-job to do that on a
regular base or use module time.sleep() together with an endless loop to
monitor that location periodically.

Show us your concrete efforts, and we will suggest improvements.

Diez



More information about the Python-list mailing list