href少一个@符号 result = html.xpath('//a[@href = "link4.html"]/../@class')
result = html.xpath('//a[@href = "link4.html"]/../@class')
text.html内容如图 本来实现:['item-1'] 但是:[ ]
我这没问题,你python什么版本,lxml什么版本
37,719
社区成员
34,238
社区内容
加载中
试试用AI创作助手写篇文章吧