rx_name_f = r'<div class="name">'
rx_name = r'<a href=.*>(.*)</a>'
name = re.compile(rx_name)
name_f = re.compile(rx_name_f)
i = False
for line in page:
name_obj = name.search(line)
namef_obj = name_f.search(line)
if i and name_obj:
name_item = name_obj.group(1)
print "Name:", name_item
i = False
else:
i = False
if namef_obj:
i = True