[Tutor] Value Error solved. Another question
Ron Nixon
nixonron at yahoo.com
Mon Feb 14 08:25:43 CET 2005
Ignore my first posting. Here's what I'm trying to do.
I want to extract headlines from a newspaper's website
using this code. It works, but I want to match the
second group in <h2><a href="(.*)">(.*)</p> and print
that out.
Sugguestions
import urllib, re
pattern = re.compile("""<h2><a
href="(.*)">(.*)</p>""", re.DOTALL)
page =
urllib.urlopen("http://www.startribune.com").read()
for headline in pattern.findall(page):
print headline
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
More information about the Tutor
mailing list