Python Using Selenium To Click On A Button Based On Type, Value, And Class January 28, 2024 Post a Comment So this is what the html looks like: Next →Solution 1: Give the text based search a shot. That's my favouritedriver.find_element_by_xpath("//*[.='Next →')]").click() CopyWith . we are directly pointing to parent in html hierarchy and * allows you to do a search without depending on any specific tagSolution 2: A solution could be:buttons = self.driver.find_elements_by_xpath("//title[contains(text(),'Next')]") actions = ActionChains(self.driver) time.sleep(2) actions.click(button) actions.perform() CopyDocumentation on Selenium Action Chain here: http://selenium-python.readthedocs.org/en/latest/api.html#module-selenium.webdriver.common.action_chains Share Post a Comment for "Python Using Selenium To Click On A Button Based On Type, Value, And Class"
Post a Comment for "Python Using Selenium To Click On A Button Based On Type, Value, And Class"