I have the following drop down list that I want to select the value "Previous Year" from:
(I've already selected the value manually)
The problem is two fold, I'm having a hard time "finding" or locating this drop down list with my code, and the number in the "id" changes page to page, so I can't just locate it by its "id". I'm trying to use the following Python 3 code:
select = driver.find_elements_by_xpath('//*[contains(@id, "dropdown-intervaltype")]')
select.click()
# then click the "Previous Year" text
and I also tried:
select = Select(driver.find_elements_by_xpath('//*[contains(@id, "dropdown-intervaltype")]'))
select.select_by_value("Previous Year")
Now this site is a private site for work, so I can't grant access, but I'm hoping someone can point out what else I can try to locate this element and select the proper drop down value? I've tried locating this field by "css" and "xpath", no luck.
xpath = //*[@id="dropdown-intervaltype31442"]
css_selector = #dropdown-intervaltype31442
full_xpath = /html/body/div[4]/div[2]/div/div[3]/div[3]/div/div[2]/div/form/table/tbody/tr/td[2]/div/div[1]/select
Any ideas to test would help. Thanks!