url = 'https://renshouxian.58.com/ershoufang/'
data_text = requests.get(url=url, headers=headers).text
# 实例化
tree = etree.HTML(data_text)
text = tree.xpath('//*[@id="esfMain"]/section/section[3]/section[1]/section[2]/div')
for i in text:
title = i.xpath('.//a/div[2]//text()')[0]
print(title)
无难点,代码于2023.8.3编写并可正常运行