The autocomplete-suggestions
is the div
that holds all the autocomplete-suggestion
's.
Here is a snip of the elements

To capture the elements I used the f8
button when searching for selenium, that way the elements don't disappear.
Here is a code snip for visualization:
def highlight_element(element):
driver_elem = element.parent
def apply_style(s):
driver_elem.execute_script("arguments[0].setAttribute('style', arguments[1]);",
element, s)
original_style = element.get_attribute('style')
apply_style("background: yellow; border: 2px solid red;")
sleep(0.5)
apply_style(original_style)
driver.get("https://www.selenium.dev/documentation/en/")
WebDriverWait(driver,30).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "#search-by")))
driver.find_element_by_css_selector("#search-by").send_keys("selenium")
WebDriverWait(driver,30).until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, ".autocomplete-suggestions .autocomplete-suggestion")))
for ele in driver.find_elements_by_css_selector(".autocomplete-suggestions .autocomplete-suggestion"):
highlight_element(ele)