I know there are similar questions but I couldn't manage to utilize the solutions. That's why I am asking for my specific problem.
My code looks like:
driver.get("https://")
driver.maximize_window()
login = driver.find_element_by_xpath(email_xpath).send_keys(email)
login = driver.find_element_by_xpath(pwd_xpath).send_keys(pwd)
login = driver.find_element_by_xpath(continue_xpath)
login.click()
time.sleep(10)
ticker = 'DB:0NU'
search = WebDriverWait(driver, 15).until(EC.element_to_be_clickable((By.XPATH, search_xpath))).send_keys(ticker)
time.sleep(10)
print(search)
elements = driver.find_elements_by_xpath("//*[@id='popup-portal']/div/div/div/div/ul")
for element in elements:
print(element.text)
try:
if element.text == ticker:
element.click()
except:
pass
I don't get any error results, but nethertheless, the solution is not satisfying, because my code doesn't select 'DB:0NU' from the search result, even though one can see it in the search result. How can I make my code click the element?
A sample of the html source code:
<ul data-cy-id="search-results-list" class="sc-gCwZxT kelPjw"><li>
Anyone who can help?