前言
python脚本内容
from feapder.network.selector import Selector
with open('a.html', 'r') as f:
text = f.read()
selector = Selector(text)
r_list = selector.xpath('//div[@class="List-item"]')
for r in r_list:
title = r.xpath('./div/div/h2/span/a/text()').extract_first()
url = r.xpath('./div/div/h2/span/a/@href').extract_first()
aurl = "https:{}".format(url)
print("{},{}".format(title,aurl))
评论 (0)