python selenium项目实战之获取排名上升的歌曲

主要任务

获取音乐网站排名上升的歌曲

具体步骤

通过元素定位发现歌曲的信息被保存在li标签里

python selenium项目实战之获取排名上升的歌曲
通过往上寻找可以找到它的上级id标签songListWrapper
python selenium项目实战之获取排名上升的歌曲
通过id 和 li 可以获取歌曲信息
python selenium项目实战之获取排名上升的歌曲
可以通过sonlist里面的li标签循环遍历歌曲的名称和信息
通过条件筛选就可以获得歌曲上升的信息了

python selenium项目实战之获取排名上升的歌曲
通过属性class定位

python selenium项目实战之获取排名上升的歌曲
可以得到最后的结果
python selenium项目实战之获取排名上升的歌曲