Double clicking in python selenium

后端 未结 2 965
别跟我提以往
别跟我提以往 2020-12-16 04:22

I am using selenium with python. Im able to get the code below to click where I want but I want it to dbl click. Im not very good with the action chains and I know I need

2条回答
  •  时光说笑
    2020-12-16 05:11

    Action chains is the only best option as far i know

    from selenium.webdriver.common.action_chains import ActionChains
    
    driver=self.webdriver
    user = self.find_element_by_id("selUsers")
    for option in user.find_elements_by_tag_name("option"):
       if option.text == "Admin, Ascender":
          actionChains = ActionChains(driver)
          actionChains.double_click(option).perform()
    

提交回复
热议问题