1

I'm trying to log into a website that requires credentials. I'm getting the following error on the password page:

ElementNotInteractableException: Element <div id="password" class="rFrNMe KSczvd uyaebd BlbNGe zKHdkd sdJrJc Tyc9J"> is not reachable by keyboard

Here is the offender.

enter image description here

Is there any work-around? I Googled for a solution on SO and saw some comments about Java. I'm using Python, and I haven't found anything that works. Here is all my code.

from bs4 import BeautifulSoup as bs
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
import time
import requests
import urllib.request
import pandas as pd  

    
wd = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
url = 'https://intra-net-website.com/'
wd.get(url)

# set username
time.sleep(2)
username = wd.find_element_by_id("identifierId")
username.send_keys("[email protected]")
wd.find_element_by_id("identifierNext").click()

# error occurs here
# set password
time.sleep(2)
password = wd.find_element_by_id("password")
password.send_keys("my_password")
wd.find_element_by_id("passwordNext").click()

If I manually enter my password everything works fine, but that defeats the purpose of automating this job. Maybe there is a way to trick the system. Not sure.

3
  • 1
    Based on your screenshot - this is an <input> element, and not div one.
    – Dekel
    Dec 16, 2018 at 16:16
  • 2
    Replace password = wd.find_element_by_id("password") with password = wd.find_element_by_name("password")
    – Andersson
    Dec 16, 2018 at 16:17
  • 1
    @Andersson - it worked! Thanks so much. I see my error. I feel really dumb now.
    – ASH
    Dec 16, 2018 at 16:21

1 Answer 1

2

From the image, it looks like you may want to send_keys to the input with name "password".

password = wd.find_element_by_name("password")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.