爬出的帖子标题不跟着更新,我这是哪里写出错了吗???
[Asm] 纯文本查看 复制代码import requests
from lxml import etree
head = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.135 Safari/537.36'}
url = 'https://www.52pojie.cn/forum.php?mod=guide&view=newthread'
resp = requests.get(url,headers=head)
resp.encoding=resp.apparent_encoding
e = etree.HTML(resp.text)
names = e.xpath('//*[@id="threadlist"]/div[2]/table/tbody/tr/th/a[1]/text()')
print(names)