[Tutor] new user question

Alan Gauld alan.gauld at btinternet.com
Tue Jan 15 23:56:38 CET 2013


On 13/01/13 16:10, Adel Afzal wrote:
> <dogs.html> contains the text "dogs chase cats"
> <cats.html> contains the text "cats chase birds"
> <pets.html> contains the text "birds don't bother anyone"
>
> I'd like to know how to search the content of those three pages for the
> string "cats" in the text body.

Look at the urllib modules in the standard library.
Also Beautiful Soup is a third part module that many find useful for 
reading HTML, especially if it is not cleanly formatted.

That assumes that although new to python you are familiar with HTML and 
parsing in general. If not then you may need more hand holding after 
reading the docs. If so come back with some specific questions so we can 
gauge your level of understanding and respond accordingly.



-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/



More information about the Tutor mailing list