I'm trying to change the elements within a form, and the later input options depend on the earlier ones. I can select options using this method for the earlier selector, but for this specific selector it clicks the object (I can see the text change) and then reverts back.
Because of this, I'm fairly certain my id is correct and it, as it does find and select the current element, but I need help in figuring out why the option will not maintain.
wait = WebDriverWait(driver,20).until(EC.presence_of_element_located(
(By.XPATH, 'xpath/option[2]')))
select = Select(driver.find_element_by_xpath('xpath'))
select.select_by_value(code)
I've tried selecting by index, visible text, and finding by id and using the click() method but none allow my option selection to be maintained. When I manually go in the form, my option selection is maintained. Furthermore in BeautifulSoup, I can't seem to post to the selector as well.
Would love help exploring why exactly this may be happening! Thanks.
edit: the issue is not that the options are not found. I find the option, and I am able to select the option. When looking at the Form Data within the network headers I can see that I'm attempting to put in the same information as I would manually.
However, less than a second after I select on the option, the selector goes back to its original state.