How to mouseover in python Webdriver

前端 未结 2 2115
盖世英雄少女心
盖世英雄少女心 2020-12-15 04:38

It seems this is the way to do hover / mouseover in webdriver, at least in the java api:

Actions action = new Actions(driver);
action.moveToElement(element).         


        
2条回答
  •  独厮守ぢ
    2020-12-15 05:09

    from selenium.webdriver.common.action_chains import ActionChains
    
    
    def hover(self):
        wd = webdriver_connection.connection
        element = wd.find_element_by_link_text(self.locator)
        hov = ActionChains(wd).move_to_element(element)
        hov.perform()
    

提交回复
热议问题