hdl = urllib.urlopen("file://localhost/D:/page.htm")
html = hdl.read()
text_file = open("file.txt", "w")
text_file = open("file.txt", "r")
contents = text_file.read()
p = re.compile('(?<=starting_html_tag).*(?=ending_html_tag)')
m = p.search(contents)
print 'Match found: ', m.group()
print 'No match'
The first script opens a particular web page and reads it into a txt file. The second script opens the txt file and looks for contents between tags 'starting_html_tag' and 'ending_html_tag'.
The problem is that the second script doesn't find anything at all. It prints 'No match'. What's the matter? [code][/code][code][/code][code][/code][code][/code][code][/code][code][/code]