r=requests.get(url,headers=headers)
html = etree.HTML(r.text)
items=html.xpath("//div[@class="result c-container "]")
-sharp
for item in items:
item
r=requests.get(url,headers=headers)
html = etree.HTML(r.text)
items=html.xpath("//div[@class="result c-container "]")
-sharp
for item in items:
item
then continue to use xpath to find elements! For example:
get the title of the article
title = item.xpath('./secation/h3[@class="text_title"]/text()')[0]
Page structure