카테고리 없음

[파이썬 -3.x] Python 3-마우스를 올려 놓았을 때만 보이는 풀다운 메뉴에서 한 줄을 클릭합니다.

필살기쓰세요 2021. 1. 24. 04:09

아래 코드를 시도해보십시오. 도움이되기를 바랍니다.

 from selenium import webdriver
 from selenium.webdriver.common.action_chains import ActionChains
  import time
  
   drive = webdriver.Firefox()
    driver.get('your url')
     ....
      steps to reach your place where that menu link is presert
       ....
       
        element = driver.find_element_by_class("rmText")
        
         putmouse = ActionChains(driver).move_to_element(element)
          putmouse.perform()
           time.sleep(2)
            texttoclick = driver.find_element_by_xpath(".//li[@class='rmText']//span[text()='MCC']")
             actions.move_to_element(texttoclick).click().perform()
             


출처
https://stackoverflow.com/questions/39917164