2025, Dec 16 01:00
How to Resolve Selenium ElementNotInteractableException on the Google Finance Search Field
Learn why Selenium hits ElementNotInteractableException on Google Finance search and fix it with robust selectors, waits, and targeting the interactable input.
Selenium tests that target public sites often hit a wall with the dreaded ElementNotInteractableException. A common case is the Google Finance search box: you locate it, send keys, and get an exception despite the selector looking correct. Below is a concise breakdown of why this happens and how to handle it safely.
Problem
The automation opens Google Finance and attempts to type a query directly into the search field by class name, then submits it.
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Chrome()
target_url = 'https://www.google.com/finance/'
browser.get(target_url)
search_box = browser.find_element(By.CLASS_NAME, 'Ax4B8.ZAGvjd')
search_box.send_keys('nvda stock')
search_box.send_keys(Keys.ENTER)
time.sleep(1)
This results in:
ElementNotInteractableException: Message: element not interactable
What’s going on
The page exposes two inputs with the same class. The first one is present in the DOM but is not interactable. Selecting it and trying to type triggers ElementNotInteractableException. The visible, usable field is the second match.
Solution
Target the second match explicitly. The quick fix is to collect all matching elements and use the second one by index.
query_field = browser.find_elements(By.CLASS_NAME, 'Ax4B8.ZAGvjd')[1]
You can also locate the inputs by a CSS attribute and wait for them to be present before indexing the interactable one.
waiter = WebDriverWait(browser, 10)
query_field = waiter.until(
EC.presence_of_all_elements_located(
(By.CSS_SELECTOR, 'input[aria-label="Search for stocks, ETFs & more"]')
)
)[1]
Here is a minimal runnable snippet that opens Google Finance, waits for the inputs, targets the interactable one, and performs the search.
import time
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
client = webdriver.Chrome()
hold = WebDriverWait(client, 10)
client.get('https://www.google.com/finance/')
input_node = hold.until(
EC.presence_of_all_elements_located(
(By.CSS_SELECTOR, 'input[aria-label="Search for stocks, ETFs & more"]')
)
)[1]
input_node.send_keys('nvda stock')
time.sleep(1)
input_node.send_keys(Keys.ENTER)
time.sleep(2)
Why this matters
Modern frontends often render duplicate or layered elements that share classes and structure but differ in interactivity. Selecting the first DOM match is not enough when the first match is hidden, detached from events, or otherwise non-interactable. Understanding this pattern saves time when debugging flaky locators.
input_element = driver.find_elements(By.CLASS_NAME, 'Ax4B8.ZAGvjd')[1] might work today. It might not work tomorrow
This is a useful reminder that index-based selection tied to dynamic markup can be fragile. The attribute-based selector with an explicit wait narrows the search to the intended inputs and still acknowledges that multiple nodes exist, making the targeting more deliberate.
Takeaways
If ElementNotInteractableException appears on what looks like the right field, verify whether there are duplicate elements and whether the first match is non-interactable. Gather all candidates and select the interactable one by index, or use a CSS attribute selector together with a wait that returns all matches and then choose the correct element. Keep in mind that UI structures change, so prefer selectors that reflect intent and make the presence of multiple nodes explicit.