代码之家  ›  专栏  ›  技术社区  ›  Hussein Esmail

有没有一种方法可以在不选择元素的情况下单击Selenium(python)?

  •  0
  • Hussein Esmail  · 技术社区  · 6 年前

    我目前正在编写一个Python程序,它使用Selenium在Google Chrome上为我自动化一个进程。只有当鼠标悬停在某个按钮上时,它才会出现。好吧,不一定是按钮本身,但当鼠标悬停在按钮上时,会出现在按钮中有动作的div。按钮的图像总是在那里。如果有人能帮忙,那就太神奇了。谢谢!

    0 回复  |  直到 6 年前
        1
  •  0
  •   undetected Selenium    6 年前

    你真的不需要 选择 要调用的元素 click() 在上面。而是你需要使用 find_element() find_element_by_*() 定位所需元素的方法 对于 visibility_of_element_located() Mouse Hover 首先在元素上。

    一旦 Tool Tip 单击() 方法。

    您可以在中找到详细的讨论 How to mouse hover a parent element and subsequently click on child element using Selenium and Action class