[Tutor] Value Error message
Ron Nixon
nixonron at yahoo.com
Mon Feb 14 08:11:40 CET 2005
Trying to scrape some headlines off a newspaper with
this code:
import urllib, re
pattern = re.compile("""<h2><a
href="(.*)">(.*)</p>""", re.DOTALL)
page =
urllib.urlopen("http://www.startribune.com").read()
for (headline, code, description) in
pattern.findall(page):
print (headline, code, description)
I'm getting the error below and can't find anything in
the documentation. Suggestions
Traceback (most recent call last):
File "C:/Python24/Stribwebscrape.py", line 13, in ?
for (headline, code, description) in
pattern.findall(page):
ValueError: need more than 2 values to unpack
__________________________________
Do you Yahoo!?
Meet the all-new My Yahoo! - Try it today!
http://my.yahoo.com
More information about the Tutor
mailing list