import requests
import lxml.html
url = 'https://www.example.htm'
source = requests.get(url).content
selector = lxml.html.fromstring(source)
phonenumber = selector.xpath('//*[@id="contact"]/div/dl/dd[4]/text()')
print(phonenumber)
python爬虫demo
最新推荐文章于 2024-08-24 11:00:49 发布