xpath捕获元素比较精准,前面也介绍了xpath的用法
现在捕获社区里帖子详情页的标题
//*[@class='discuss_detail_header___3LhnQ']/h1
找到class是discuss_detail_header___3LhnQ的子元素h1
获取文章内容
//*[@id='w-e-textarea-1']
找到id是w-e-textarea-1的元素
获取元素的源代码,就可以获取到html内容了
xpath捕获元素比较精准,前面也介绍了xpath的用法
现在捕获社区里帖子详情页的标题
//*[@class='discuss_detail_header___3LhnQ']/h1
找到class是discuss_detail_header___3LhnQ的子元素h1
获取文章内容
//*[@id='w-e-textarea-1']
找到id是w-e-textarea-1的元素
获取元素的源代码,就可以获取到html内容了
雪狼骑兵阅读 573
macrozheng赞 2阅读 3k
阮小贰赞 6阅读 13k评论 1
vivo互联网技术赞 3阅读 1.9k评论 1
Pursuer丶赞 3阅读 8.7k
阮小贰阅读 30.5k评论 1
阮小贰阅读 21.2k评论 2
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。