mport requestsfrom lxml import etreeimport jsonif __name__ == "__main__": headers={"User-Agent":'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/网页链接 Safari/537.36 Edg/124.0.0.0'} url='https://movie.douban.com/review/15936298/' res = requests.get(url=url,headers=headers) xml=网页链接 tree = etree.HTML(xml) div_list = tree.xpath("//div[@class='short-content']/p[@class='spoiler-tip']/text()") print(div_list)
是xpath写错了吗?
是xpath写错了吗?