I need to select the search button and Click, but I can't because it doesn't have an identifier
<button _ngcontent-ng-cli-universal-c118 mat-mini-fab class="mat-focus-indicator ml-1 mat-ini-fab mat-button-base mat-primary ng-star-inserted">
<span class="mat-button-wrapper">
<mat-icon _ngcontent-ng-cli-universal-c118 role="img" class="mat-icon notranslate material-icons mat-icon-no-color" aria-hidden="true">search</mat-icon>
</span>
<div matripple class="mat-ripple mat-button-ripple mat-button-ripple-round"></div>
<div class="mat-button-focus-overlay"></div>
</button>
I use this, but it doesn't work:
driver.find_element_by_xpath(".//*[contains(text(), 'search')]").click()
Error:
Message: element not interactable
(Session info: chrome=84.0.4147.105)
File "Chrome1.py", line 39, in <module>
driver.find_element_by_xpath(".//*[contains(text(), 'search')]").click()
use
button1 = WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH,"//button/span/mat-icon[contains(text(),'search')]"))).click()
Error:
Message: element click intercepted: Element <mat-icon _ngcontent-ng-cli-universal-c118="" role="img" class="mat-icon notranslate material-icons mat-icon-no-color" aria-hidden="true">...</mat-icon> is not clickable at point (817, 112). Other element would receive the click: <header _ngcontent-ng-cli-universal-c35="" class="fixed-top">...</header>
(Session info: chrome=84.0.4147.105)
File "Chrome1.py", line 37, in <module>
button1 = WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH,"//button/span/mat-icon[contains(text(),'search')]"))).click()