新写的代码就报错,然后我把之前的代码复制过来套进去,就不会报错了。
a_list=tree.xpath('//div[@class="slist"]/ul/li')
print(a_list)
AttributeError: module 'lxml.etree' has no attribute 'xpath'
新写的代码就报错,然后我把之前的代码复制过来套进去,就不会报错了。
a_list=tree.xpath('//div[@class="slist"]/ul/li')
AttributeError: module 'lxml.etree' has no attribute 'xpath'