On Sun, 22 Apr 2007 23:28:23 +0200, Gilles Ganault <[EMAIL PROTECTED]>
wrote:
>I'd like to make sure there isn't an easier way to extract all the
>occurences found with re.finditer:

Oops, s/match/item/:

req = urllib2.Request(url, None, headers)
response = urllib2.urlopen(req).read()
matches = re.compile("(\d+).html").finditer(response)
# ----------- BEGIN
for item in matches:
        if mytable[item]=="":
                mytable[item]= match.group(1)
        else:
                mytable[item]= mytable[item] + "," + match.group(1) #
----------- END
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to