I am trying access a page which requires me to select an option from a drop down menu.
When i run my code atm, I get an error where it says it was unable to locate the drop down element by id. I do not know how to remedy this situation, as I am copying and pasting the elements id.
from selenium import webdriver
from selenium.webdriver.support.select import Select
import time
driver = webdriver.Firefox()
driver.get('http://webapp.northampton.edu/coursesearch/default.aspx')
time.sleep(1)
dropdown = driver.find_element_by_id('pg0_V_ddlTerm')
select_box = Select(dropdown)
time.sleep(1)
select_box.select_by_value('2015;S2')
I also tried selecting by name, but that also proved fruitless. Once I select the dropdown I am attempting to select the option S2 2015.
Thank you for your help!
Edit: I put in the time.sleep because I thought perhaps the website wasn't fully loaded by the time is was trying to select the drop down.