tree = etree.HTML(html) for block in tree.xpath("//div[@class='product']"): img = block.xpath("//img/@src")[0] name = block.xpath("//tr[@class='name']")[0].text id = block.xpath("//tr[@class='id']")[0].text