I am trying to select a dropdown option in the form using Selenium webdriver in Python. The XPATH is correct, I also verified it is going to the right dropdown option but in the end it is not selecting it.
I have tried similar code for another website that has a dropdown. But it's not working for this particular website.
Can someone please help out with this?
from selenium import webdriver driver = webdriver.Chrome("C:\\Users\\xxx\\Downloads\\chromedriver_win32\\chromedriver.exe") driver.get("https://www.cersai.org.in/CERSAI/dbtrsrch.prg") elem = driver.find_element_by_xpath("//select[@id='borrowerType']") all_options = elem.find_elements_by_tag_name("option") for option in all_options: if option.get_attribute("value") == "IND": option.click() break