import requests
headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36"}
url = "https://www.xinpianchang.com/discover/article?from=navigator"
response = requests.get(url, headers=headers)
print(response)
from lxml import etree
tree = etree.HTML(response.text)
elements = tree.xpath('//h2[@class="truncate block"]')
for element in elements:
print(element.text)
print(tree.xpath('//*[@id="__next"]/section/main/div/div/div/div/div/a/div/ul/li[1]/span[2]')[0].text)
print(tree.xpath('//*[@id="__next"]/section/main/div/div/div/div/div/a/div/ul/li[2]/span[2]')[0].text)
print(tree.xpath('/html/body/div/section/main/div/div/div/div/div/div/a/h2')[1].text)