I have a problem with finding a WebElement in Selenium. I tried to fill the input field, this is the html:
<div class="container">
<div class="tp-fl" id="btnSearchStockAutoComplete">
<span class="tp-icon tp-search tp-co-3 "></span>
</div>
<angucomplete placeholder="search" searchfields="Not Found" pause="400" set-focus="tpFocus" selectedobject="tpSelected" titlefield="label" inputclass="form-control form-control-small" matchclass="highlight" api="tpApi" disable="disableSearchBox" stockdetails="stockdetails" class="ng-isolate-scope">
<div class="tp-re angucomplete-holder tp-width">
<div id="fulltextContainer" style="display: none" class="symbol-info tp-etc">
</div>
<input id="txt_search" class="search-box tp-co-1 tp-pa-rl-5 tp-re tp-bo-bo" type="text" placeholder="Search" onmouseup="this.select();" autocomplete="off">
<div id="auto-list-container" class="auto-list-container tp-bg-2 tp-co-1 tp-bo-4 tp-bo tp-width angucomplete-dropdown" style="min-width: 250px; display: none">
<div style="display: none" id="loading" class="tp-h-35 tp-pa-rl-10 angucomplete-searching">Searching ...</div>
<div style="display: none" id="norecord" class="tp-35 tp-pa-rl-10 angucomplete-searching">Not Found </div>
<div id="list_dropdown">
</div>
</div>
</div>
</angucomplete>
</div>
this is my code in python:
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
browser=webdriver.Chrome('path')
inputTxt=browser.find_element_by_xpath('//*[@id="txt_search"]')
inputTxt.send_keys('stock')
but when I run this program, it gives me an error and throws an exception, "selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable", I was wondering if there is any possible solution to this problem.
inputTxt.location_once_scrolled_into_viewwhich will scrolled the element into view. Then try send_keys.inputTxt=browser.find_element_by_css_selector('app-content#txt_search')(the input field I want with id='txt_search' is inside the app-content tag), but it throws NoSuchElementException, I'm confused what the right style is to reach this element?