3

Here is my code:

from selenium import webdriver

user = "[email protected]"

browser = webdriver.Chrome("/path/to/browser/")

browser.get("https://www.quora.com/")

username = browser.find_element_by_name("email")

browser.implicitly_wait(10)

username.send_keys(user)

Here is the error message:

selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable

I think there is another thread with a similar issue. Either the solutions in that thread didn't work for me or I don't know how to implement the solutions.

2
  • 2
    find by name return multiple elements you can try with different locators like "ID". Commented May 2, 2019 at 4:46
  • try out the answer given below, and let us know if any one of them worked for you. Commented May 2, 2019 at 5:52

5 Answers 5

2
find_element_by_name("email")

is present multiple times in DOM. So that wouldn't work.

You can try with this css selector :

input[class*='header_login_text_box'][name='email']  

Code :

username = browser.find_element_by_css_selector("input[class*='header_login_text_box'][name='email']")

username.send_keys("[email protected]")
Sign up to request clarification or add additional context in comments.

Comments

2

To send a character sequence to the Email field within Login section of Quora you need to induce WebDriverWait for the element to be clickable and you can use the following solution:

  • Code Block:

    from selenium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    
    options = webdriver.ChromeOptions() 
    options.add_argument("start-maximized")
    options.add_argument("--disable-extensions")
    # options.add_argument('disable-infobars')
    driver = webdriver.Chrome(chrome_options=options, executable_path=r'C:\Utility\BrowserDrivers\chromedriver.exe')
    driver.get("https://www.quora.com/")
    WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, "//div[@class='title login_title' and text()='Login']//following::div[1]//input[@class='text header_login_text_box ignore_interaction']"))).send_keys("[email protected]")
    
  • Browser Snapshot:

quora_email

1 Comment

This worked like a charm for a clicking a link within a popup after clicking a link on a webpage! +1 Nothing else I was trying was working.
0

As said in comment, the locator used returning two elements and required element is second one. driver trying to interact with first element, so exception is throwing.

good see in console, the locator returning required one or not.

> $$("[name='email']") (2) [input#__w2_wD9e9Qgz12_email.text, input#__w2_wD9e9Qgz18_email.text.header_login_text_box.ignore_interaction]
> 0: input#__w2_wD9e9Qgz12_email.text 1:
> input#__w2_wD9e9Qgz18_email.text.header_login_text_box.ignore_interaction
> length: 2
> __proto__: Array(0)

go for another locator, if not able to figure it out another locator, then comment, will help you.

Comments

-1
from selenium import webdriver

user = "[email protected]"

browser = webdriver.Chrome("/path/to/browser/")

browser.get("https://www.quora.com/")

username = browser.find_element_by_xpath("//input[@class='text header_login_text_box ignore_interaction' and @type='text']")

browser.implicitly_wait(10)

username.send_keys(user)

Here You can find Why ElementNotInteractableException occurs.

2 Comments

The id you have given is not static and that's a dynamic. For me your ID is not working, I'm sure this wouldn't work for OP as well.
@cruisepandey Done. Update answer with proper xpath.
-1

If you are using the Select aproach like:

from selenium.webdriver.support.select import Select

try this

Select(WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH, '''//*[@id="ReportViewer1_ctl04_ctl07_ddValue"]''')))).select_by_visible_text(str(x))

1 Comment

Looks like you're also calling on the expected_conditions module...did you forget an import statement?

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.