selenium鼠标悬停操作

有些网页一打开会有一个弹窗,弹窗不消失无法进行取元素操作,只有把鼠标悬停在上面弹窗才会消失,这时就用到了selenium的悬停操作

鼠标悬停  move_to_element()

定位到要悬停的元素
move = driver.find_element_by_id("xx")
对定位到的元素执行悬停操作
ActionChains(driver).move_to_element(move).perform()
原文地址:https://www.cnblogs.com/z-x-y/p/9718204.html