I want to click on an option in a drop down menu. The options have label values. The dropdown menu is not from a select element. It is an input element with a drop down arrow next to it.
The dropdown arrow has the following attributes
<span id="ctl00_ContentPlaceHolder1_ReportViewer1_ctl09_ctl21_ctl01" class="glyphui glyphui-downarrow" style="cursor: pointer;"></span>
I managed to open the dropdown menu by clicking on the dropdown arrows by doing
Bedrijfsindeling_dropdown = driver.find_element_by_xpath('//span[@id="ctl00_ContentPlaceHolder1_ReportViewer1_ctl09_ctl21_ctl01"]')
Bedrijfsindeling_dropdown.click()
time.sleep(1)
I am not able to find a way to select any option. The label looks like:
<label for="ctl00_ContentPlaceHolder1_ReportViewer1_ctl09_ctl21_divDropDown_ctl04">
Baggerbedrijf</label>
I want to be able to select for the "Baggerbedrijf" part.
Ultimately I want to select all options one by one, but for now it is sufficient to only be able to select "Baggerbedrijf"
I tried finding the label with driver.find_element_by_xpath('//label[@for="ctl00_ContentPlaceHolder1_ReportViewer1_ctl09_ctl21_divDropDown_ctl04"")']
and then clicking on it.
However, i get the "no such element" message.
How would i be able to select the option for "Baggerbedrijf"?