replace link in html

Xah Lee xah at xahlee.org
Thu May 29 05:51:49 EDT 2003


how can i write a script that goes thru a directory, find each .html
file, replace links of the form

<a href="....suffix">some text</a>

by some other text, where the suffix is one of .mov, .nb and others.
Note the link may not be in one line, so i need some kind of html
parser instead just regex search replace. (that's where i'd be stuck)

i'm a python beginner.

thanks.

 Xah
 xah at xahlee.org
 http://xahlee.org/PageTwo_dir/more.html




More information about the Python-list mailing list