def New_Page_Info(new_page):
 dom = etree.HTML(new_page)
 new_items = dom.xpath('//tr/td/a/text()')
 new_urls = dom.xpath('//tr/td/a/@href')
 assert (len(new_items) == len(new_urls))
 return zip(new_items, new_urls)

def New_Page_Info ( new_page ) : dom = etree . HTML ( new_page ) new_items = dom . xpath ( '//tr/td/a/text()' ) new_urls = dom . xpath ( '//tr/td/a/@href' ) assert ( len ( new_items ) == len ( new_urls ) ) return zip ( new_items , new_urls )
regex or xpath .