Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98353

ElementNotInteractableException - Python / selenium not duplicate

$
0
0

Having trouble .sendkeys to the password text box after it has been selected and i can see the cursor flashing waiting for some text input

This is the html

<div class="hm-Login ">
    <div class="hm-Login_UserNameWrapper ">
        <input type="text" class="hm-Login_InputField ">
        <div class="hm-Login_InputText ">Join</div>
    </div>
    <div class="hm-Login_PasswordWrapper ">
        <input type="text" class="hm-Login_InputField ">
        <input type="password" class="hm-Login_InputField Hidden ">
        <button tabindex="0" class="hm-Login_LoginBtn ">GO</button>
        <div class="hm-Login_InputText ">Lost Login?</div>
    </div>
</div>

this is my code

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

import time
from selenium import webdriver

driver = webdriver.Chrome("xxxxx/chromedriver")

driver.get('https://www.bet365.com.au/#/HO/');
driver.find_element_by_xpath("//*[@id='TopPromotionBetNow']").click()

WebDriverWait(driver, 5).until(EC.element_to_be_clickable((By.XPATH, "//input[@type='text']"))).click()

driver.find_element_by_class_name("hm-Login_InputField").click()                                          
#time.sleep(5) # Let the user actually see something!

#username
elem = driver.find_element_by_class_name("hm-Login_InputField")
elem.click()
elem.clear() 
elem.send_keys("xxxx")

#password
elem = driver.find_element_by_xpath("//div[@class='hm-Login_PasswordWrapper ']//input[@type='text']")
#elem = driver.find_element_by_xpath("//input[@type='text']")
elem.clear() 
elem.click()

#attempt 1
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//div[@class='hm-Login_PasswordWrapper ']//input[@type='text']"))).send_keys("xx")

#attempt 2
driver.implicitly_wait(10) # seconds
elem.send_keys("xxxxx!")

this is the error ElementNotInteractableException: element not interactable

any help is appreciated.. you can see my attempts at the bottom of the code...


Viewing all articles
Browse latest Browse all 98353

Trending Articles