I'm trying to scrape a real estate website for listings. It has an aspx form that has to filled out before submission.
http://www.cbre.us/PropertyListings/Pages/Properties-for-Sale.aspx
All I care about is multifamily properties in Oregon, however. So this was my first attempt:
driver = webdriver.Firefox()
driver.get("http://www.cbre.us/PropertyListings/Pages/Properties-for-Sale.aspx")
#Searching for multifamily residences
selectPropertyType = driver.find_element_by_id("ForSalePropertyType")
selectPropertyType.select_by_value("70")
#In the state of Oregon
selectState = driver.find_element_by_id("ForSaleState_ListBox1")
selectState.select_by_value("OR")
#Submit form
submitBtn = driver.find_element_by_id("ForSaleLooplinkSubmit")
submitBtn.click()
#Wait for results to load
WebDriverWait(driver, 5)
When I run this script it gives an error "Can't locate element "ForSalePropertyType". What am I doing wrong here? Thanks in advance.