Implementing 'click()' function in Python 3 for automation with Selenium. -
not able 'click()' function work me open dropdown menu. working on webcite: http://www.titleboxing.com/ looking automate upper left navtab 'gloves', if point on, drops additional links. first 1 boxing traning/sparring gloves. automate 'click()' on link. tried 'click()' finding element by_xpath, by_css , link-text. selenium returns element not clickable. if know approach should use automate 'click()' on link page moves : http://www.titleboxing.com/gloves/training-sparring-boxing-gloves?
this not best way should work.try code:
from selenium import webdriver selenium.webdriver.common.action_chains import actionchains selenium.webdriver.common.by import import time driver = webdriver.chrome() url= "http://www.titleboxing.com/" driver.maximize_window() driver.get(url) time.sleep(2) #this close popup try: driver.find_element(by.css_selector,'.fancybox-item.fancybox-close').click() except: pass action = actionchains(driver) action.move_to_element(driver.find_element(by.css_selector,'.level-top>span')) action.click() action.perform() time.sleep(2) driver.find_element(by.css_selector,'.level1.nav-1-1.first>a').click()
Comments
Post a Comment