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

import urllib, re
pattern = re.compile("""<h2><a
href="(.*)">(.*)</p>""", re.DOTALL)
page =
for headline in pattern.findall(page):
    print headline

Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 

More information about the Tutor mailing list