Python中selenium的鼠标动作为何不工作?

safari 11(highserria) 环境,有一个 element 需要鼠标 hover 上才能显示,想实现 hover 并点击的动作,可是在给足了加载时间之后,执行下面的代码,鼠标不悬停 element 不显示。 zoom_out_button = driver.find_element_by_class_name('zoom-out-right-button-control-bar') print('Visiable?', zoom_out_button.is_displayed()) fasle ActionChains(driver).move_to_element(zoom_out_button).click(zoom_out_button).perform() 想请教一下为什么 action 不工作呢?下面是目标 js。也就是 https://www.tradingview.com/chart/f8my3Ybg 图表下方的放大缩小图标。google 说 safari 和 chrome 有个缺陷,不过确认了不是我这个版本。有点闹不明白了。

………… <svg rel="nofollow" xmlns="<a href=">http://www.w3.org/2000/svg" viewbox="0 0 120 120" width="16" height="16" class="zoom-out-right-button-control-bar"> …… <</svg>

Python中selenium的鼠标动作为何不工作?

4 回复

直接修改 css 不可以吗


我无法理解你的问题。

google 过程中看到过这个思路,就是没看到代码,不知道要去学那部分知识

不是有 executeScript 吗,用它来修改样式呀

回到顶部