Skip to content Skip to sidebar Skip to footer

Python: How To Select Option From Drop Down Menu In Selenium, Element Hidden

I'm trying to fill out a form on this site: https://p2c.coweta.ga.us/p2c/jailinmates.aspx (click 'filter inmate list', then click + button to add a row) def coweta_search(last, fi

Solution 1:

I managed to get it working by changing the last line to:

driver.find_element_by_css_selector("tr.sf:nth-child(2) > td:nth-child(2) > select.field1 > option:nth-child(7)").click()

I believe the selector that you have provided is not unique and selenium is getting confused.

You can also get the selectors directly by right clicking the element in the inspection menu and selecting copy selector.

enter image description here

Post a Comment for "Python: How To Select Option From Drop Down Menu In Selenium, Element Hidden"