[Tutor] new user question

Adel Afzal adel.afzal at gmail.com
Sun Jan 13 17:10:17 CET 2013


Hi,

I am new to Python, and my interest in learning is to make a Python 
script that can do something like what I describe below.  Could you 
please provide some advice, or direct me to some resources that may help 
me along in this process?


Lets say there are three pages:

http://bob.com/dogs.html
http://bob.com/cats.html
http://bob.com/birds.html

<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.

I'd like to then output the URLs, whose html files contain "cats", as a 
plain text list. Like this:

<output.txt>:
http://bob.com/dogs.html
http://bob.com/cats.html

Kind regards,

Adel
adel.afzal at gmail.com


More information about the Tutor mailing list