xpath用发

1.获取文本

html/head/title/text()  #  获取html下head下title的文本

2.获取属性

head/link/@href   # 获取head下的link的href属性

3.定位

//标签名[@属性名="属性值"]

//section[@id="list"]/section//div[@class="_20vb2"]/p/text()

猜你喜欢

转载自www.cnblogs.com/yifengs/p/11733822.html