how to get and search a html file from a website

Paul Anton Letnes paul.anton.letnes at gmail.com
Tue Feb 1 16:27:23 EST 2011


Den 01.02.11 22.20, skrev Tracubik:
> 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

Of course there is a pythonic way :-)

 >>> import urllib
 >>> urllib.urlretrieve('http://docs.python.org/tutorial/index.html', 
'tut.html')

Good luck,
Paul.



More information about the Python-list mailing list