selenium python 自动滑块检测

思路

 

爬图片

image.png

  目标检测:Canny边缘检测后正交相似匹配定位,求得相对水平距离 distance。注意根据页面图像元素 clientWidth,和原图像尺寸做一次尺度缩放。

 6419f6a178e43fc30d9b958f7f307bd.jpg

  用selenium模拟鼠标运动,copyhttps://github.com/CharlesPikachu/SeleniumLogin

  ‍

效果

  ‍

  autoslider.gif

遇到的问题

  本来想直接用edgedriver的,但是edgedriver启动直接报错,https://stackoverflow.com/questions/72546992/selenium-python-doesnt-work-gpu-process-launch-failed-error-code-2, 但没有找到解决方法。最后用的火狐,正常运行。

  ‍

留下你的脚步
推荐阅读