how to get and search a html file from a website

Corey Richardson kb1pkl at aim.com
Tue Feb 1 16:33:16 EST 2011


On 02/01/2011 04:20 PM, Tracubik wrote:
> Hi all!
> i'm writing a notification program and i'm quite new to python.
> The program have to check every 5 minutes a particular website and alert 
> me when a particular sentence ("user online") is in the html.
> i've thinked to use a text browser (lynx) to retrieve the html and parse 
> the output in python as a normal text file.
> Do you have any better idea?
> 
> thanks
> Medeo

urllib2

http://docs.python.org/howto/urllib2.html

If you need fancy-shmancy parsing, look into:

 http://docs.python.org/library/htmlparser.html

Or you can treat the returned site as a string and just search for that
sentence.



More information about the Python-list mailing list