I'm attempting to iterate through a dropdown list for webscraping and I've noticed that my code isn't working out
dropdown = browser.find_element_by_XPATH('//*[@id="department-dropdown"]')
select = Select(dropdown)
select.select_by_value("Accounting")
ERROR MESSAGE I RECIEVE
Traceback (most recent call last):
File "C:\Users\David\eclipse-workspace\Web_Scrap\setup.py", line 31, in <module>
dropdown = browser.find_element_by_XPATH('//*[@id="mainContent"]/div[1]/div/div[3]/div/div/span')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_XPATH'
For now I was attempting to select atleast the first value, but it just isn't working out
The picture provided has the "inspect element" of the dropdown box i'm attempting to cycle through
This seems a bit confusing that the dropdown box element isn't a part of the actual list, can someone give me an idea of what is actually going on here? and if I'm looking at this incorrectly.
And if anyone has any recommendations on what I can do to achieve my goal