[Python] how to click or submit ng-click form using python selenium

Discussão em 'Python' iniciado por Stack, Fevereiro 14, 2025.

  1. Stack

    Stack Membro Participativo

    submitting ng-click form button using python selenium

    I try to submit a from using selenium but when I pass click method nothing happens

    the button html:

    <button type="submit" class="btn btn-default center-block btn-send col-sm-12" aria-label="כניסה לחשבון שלי" ng-click="vm.ResendNewLogin('password','login')" role="button" data-uw-rm-kbnav="role" tabindex="0">
    <span ng-show="vm.isSubmitting" class="myLoader ng-hide">
    <img src="/statics/img/ajax-loader-snake-tr.gif" height="18">
    </span>
    <span ng-bind="vm.epiData.LoginButtonText" class="ng-binding">כניסה לחשבון שלי</span>
    </button>


    in my code I tried several methods but nothing works

    WebDriverWait(driver , 10).until(EC.element_to_be_clickable((By.XPATH, '//*[@id="otpLobbyFormPassword"]/button'))).click()
    # Wait for the element with ng-click to be clickable
    ng_click_element = WebDriverWait(driver, 10).until(
    EC.element_to_be_clickable((By.XPATH, '//*[@id="otpLobbyFormPassword"]/button'))
    )
    ng_click_element.click()
    element = driver.find_element(By.XPATH,"//*[@aria-label='כניסה לחשבון שלי']").click()
    actions = ActionChains(driver)
    actions.move_to_element(element).click().perform()
    driver.quit()

    Continue reading...

Compartilhe esta Página