百度搜索结果列表html元素分析


第一种

百度搜索结果列表html元素分析

百度搜索结果列表html元素分析

这个结果中class也包含了result,但是没有new-pmd

第二种

百度搜索结果列表html元素分析

底部相关搜索

百度搜索结果列表html元素分析

正常的结果如图所示

 

百度搜索结果列表html元素分析

 

百度广告

百度搜索结果列表html元素分析

 

百度汉语

百度搜索结果列表html元素分析

 

百度百科

百度搜索结果列表html元素分析

爱采购

百度搜索结果列表html元素分析

百度贴吧

百度搜索结果列表html元素分析

样式汇总

正常内容result c-container new-pmd
gitee.comc-container result
中间的他人搜索result-op c-container new-pmd
底部相关搜索result-molecule new-pmd
广告,父级就一个div包起来,没有样式 
百度汉语result-op c-container new-pmd
百度百科result-op c-container xpath-log new-pmd
爱采购result-op c-container xpath-log new-pmd
百度贴吧result-op c-container xpath-log new-pmd

正确的定位方法

results = html.find("#content_left .result.new-pmd")

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
管理员
上一篇:Python使用html解析包Requests-html运行py文件没问题,Pyinstaller打包exe后运行报错
下一篇:Python退出主进程后子线程不会退出的解决方案
评论列表

发表评论

评论内容
昵称:
关联文章

PVE硬盘对应SATA口查询

联系我们
联系电话:15090125178(微信同号)
电子邮箱:garson_zhang@163.com
站长微信二维码
微信二维码