1

Hi I want to click on this button but I don't know how to find it, it has no explicit NAME or ID, also, what is the code to simulate a mouse click?

This is the HTML:

<button class="aOOlW  bIiDR  " tabindex="0">Accept All</button>

This is the part of the code:

auth = driver.find_element(By.CLASS_NAME, 'aOOlW  bIiDR  ')
auth.send_mouse(Keys.LEFT)

As you can see send_mouse(Keys.LEFT) doesn't work.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
xtekky
  • 572
  • 1
  • 4
  • 13

1 Answers1

0

There is no such method as send_mouse(Keys.LEFT)


To click() on the element with text as Accept All you can use either of the following locator strategies:

  • Using css_selector:

    driver.find_element(By.CSS_SELECTOR, "button[tabindex='0']").click()
    
  • Using xpath:

    driver.find_element(By.XPATH, "//button[text()='Accept All']").click()
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352