fni 发表于 2020-11-24 22:09:10

xpath

我想利用xpath获取href里面的这一串代码该怎么获取呢?求大佬给出解决方式!!!

笨鸟学飞 发表于 2020-11-24 22:22:46

https://fishc.com.cn/thread-184355-1-1.html

BeautifulSoup模块+select()函数很给力,不妨试试?   

braga 发表于 2020-11-25 00:22:47

html.xpath(".//a[@class="ag_ele_a"]/@href")

YunGuo 发表于 2020-11-25 02:09:30

//*[@id="ag_main_list"]/div/a/@href

Ygh6688 发表于 2020-11-25 08:58:36

//div[@class=“ag_ele ag_ele_v”]/a/@href

狗宁 发表于 2020-11-25 09:16:23

右键 copy xpath 然后找href

fni 发表于 2020-11-26 20:21:08

笨鸟学飞 发表于 2020-11-24 22:22
https://fishc.com.cn/thread-184355-1-1.html

BeautifulSoup模块+select()函数很给力,不妨试试?

是的,最近有在看了

fni 发表于 2020-11-26 20:22:22

狗宁 发表于 2020-11-25 09:16
右键 copy xpath 然后找href

这样好像会有错误吧

fni 发表于 2020-11-26 20:23:25

假面的假面 发表于 2020-11-24 23:58


好的,我试试看
页: [1]
查看完整版本: xpath