How to extract a part of html file

Joe dinamo99 at lycos.com
Thu Oct 20 01:35:05 EDT 2005


I'm trying to extract part of html code from a tag to a tag code begins
with <span class="boldyellow"><B><U>  and ends with 
TD><TD> <img src="http://whatever/some.gif"> </TD></TR></TABLE>

I was thinking of using a regular expression however I having hard time
getting the desired string. I use 

htmlSource = urllib.urlopen("http://address/")
s = htmlSource.read()
htmlSource.close()

to get the html into a string, now I want to match string s from a  <span
class Tag to <img src="http://whatever/some.gif"> </TD></TR></TABLE> and
store that into a new string. 

Thanks 



More information about the Python-list mailing list