10681/how-click-search-button-using-selenium-web-driver-and-python
I am trying to click the button but it is not working
<button value="1" class="_42ft _4jy0 _4w98 _4jy3 _517h _51sy _4w97" aria- label="Search" tabindex="-1" data-testid="facebar_search_button" type="submit"><i class="_585_"></i></button>
Below will help Use xpath :- //button[@value='1' and @label='Search']
searchbutton = driver.find_element_by_xpath(//button[@value='1' and @label='Search'])
Try this will work:
JavascriptExecutor js = (JavascriptExecutor) driver;//create instance of javascript executor to do actions WebElement buttonSubmit= driver.findElement(By.xpath("//button[@class='_42ft _4jy0 _4w98 _4jy3 _517h _51sy _4w97']")); js.executeScript("arguments[0].click();", buttonSubmit);
You can try with tag.
#this code will get the list of tags and select the second tag from the list element = driver.find_elements_by_tag_name('button')[1] #this will click the element element.click()
Ref: https://stackoverflow.com/questions/49063338/trying-to-click-on-the-button-tag-in-selenium-web-driver-using-python
Hello Nitin, as the Like button on ...READ MORE
I used xpath for loacting the male ...READ MORE
...READ MORE
I want to click the 'OK' button ...READ MORE
Hey Hemant, for installing Selenium Webdriver with ...READ MORE
The better way to handle this element ...READ MORE
enable trusted connection in internet explorer by ...READ MORE
To Allow or Block the notification, access using Selenium and you have to ...READ MORE
Create a profile for chrome and define ...READ MORE
If ALL_USA is subject to change, then ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.