标签:sele pat pre top com img pip class imp
pip install parsel
1 import parsel 2 3 4 sel = parsel.Selector(html) 5 xp = sel.xpath(‘//div[@class="item top"]/p/a/text()‘).get() 6 print(xp)
注意:get()是获取单个值,getall()是获取全部的值
标签:sele pat pre top com img pip class imp
原文地址:https://www.cnblogs.com/zihkj/p/12363172.html