This is my function to click:
def auto_click(xpath, interval, duration): start_time = time.time() while time.time() - start_time < duration: try: button = WebDriverWait(driver, 10).until( EC.element_to_be_clickable((By.XPATH, xpath)) ) if button.is_displayed() and button.is_enabled(): button.click() return except Exception as e: print(f"error") time.sleep(interval)
This is the element of that button:
<material-button animated="true" class="btn btn-yes _nghost-jzk-8 _ngcontent-jzk-96 highlighted" tabindex="0" role="button" aria-disabled="false" raised="" elevation="1"><div class="content _ngcontent-jzk-8">Lưu và tiếp tục</div><material-ripple aria-hidden="true" class="_ngcontent-jzk-8"><div class="__acx-ripple" style="top: -116px; left: -48.5px; transform: translate(-22.2891px, 6px) scale(0.546686);"></div></material-ripple><div class="touch-target _ngcontent-jzk-8"></div><div class="focus-ring _ngcontent-jzk-8"></div></material-button>
You need to sign in to view this answers
Leave feedback about this