My website form have updated and my script is no more working. I cannot fix it because I'm not able to find how to select in a dropdown content using selenium chrome web driver and python.
formattedstate is the value of a formatted data (read from a file)
driver.find_element_by_css_selector(f"option[title='{formattedState}']").click()
driver.find_element_by_xpath("//*[text()='{formattedState}']").click()
driver.find_element_by_css_selector(f"option[value='{formattedState}']").click()
This is the data of the dropdown content from the webform. I selected the first state in the dropdown = Alabama
<input aria-valuetext="" role="combobox" tabindex="0"
placeholder="State/Province/Region" readonly="" height="100%" size="1" autocomplete="off" value="" data-spm-anchor-id="a2g0o.placeorder.0.i14.5f0b321eC7zfLx">
<li class="next-menu-item" title="Alabama" data-spm-anchor-id="a2g0o.placeorder.0.i17.5f0b321eC7zfLx">Alabama</li>
It should select the correct state in the dropdown content