I need to click on the dropdown list of items that are hidden and only the list visible once we click on the particular search box.
HTML TAG:
<div class="main-search_suggestions suggestions-list-container search-suggestions-list-container hidden" data-component-bound="true">
<ul class="suggestions-list" role="listbox" aria-label="Search results">
<li class="item suggestion suggestions-list-item " role="option" tabindex="0" aria-label="category" data-suggestion-type="category" data-param-type="find_desc" data-suggest-query="Restaurants" data-ajax-data="null">
<li class="item suggestion suggestions-list-item " role="option" tabindex="0" aria-label="category" data-suggestion-type="category" data-param-type="find_desc" data-suggest-query="Universities" data-ajax-data="null">
<li class="item suggestion suggestions-list-item " role="option" tabindex="0" aria-label="category" data-suggestion-type="category" data-param-type="find_desc" data-suggest-query="Hospitals" data-ajax-data="null">
<li class="item suggestion suggestions-list-item " role="option" tabindex="0" aria-label="category" data-suggestion-type="category" data-param-type="find_desc" data-suggest-query="Hotels" data-ajax-data="null">
</li>
</ul>
</div>
from the above Html how to click those lists of items with either XPath/tag_name/class_name in python selenium based on the index value ?.
EDIT: (My code)
def vendor_list():
zipcode = (str(input("enter the zipcode:")))
driver = open_driver_connection()
print("Openning")
driver.get('URL OF MY WEB PAGE')
zipcode_value = driver.find_element_by_id('dropperText_Mast')
zipcode_value.clear()
zipcode_value.send_keys(zipcode)
service_box = WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.ID,"find_desc"))).click()
drop_down = driver.find_elements_by_xpath("//*[@id='header_find_form']/div/div[1]/div/div/ul/li")
for lists in drop_down:
lists.click()
time.sleep(1)