My code was working fine earlier but now when I run the code I get the following error in my console:
C:\Users\Documents\NetBeansProjects\BudgetHome>python cmpm.py
download_dir is not empty! Will now attempt to delete all files
All files have been removed from C:\Users\Documents\NetBeansProjects\Budg
etHome\downloads
Download Directory: C:\Users\Documents\NetBeansProjects\BudgetHome\downlo
ads
Opening Chrome
DevTools listening on ws://127.0.0.1:12019/devtools/browser/96faa11d-113e-444d-9
fb0-70dee233185e
Authenicating
Load CMPM home
Opening CMPM Datamart reports
elem clicked
Attemting to switch to frame 0
New window should be opening
Waiting for window to load, waiting 60 seconds
Found elem: <selenium.webdriver.remote.webelement.WebElement (session="06457076a
856edb1022910e647d858af", element="0.12555711894711363-1")>
Fililng out form for: xxxxxx
Traceback (most recent call last):
File "cmpm.py", line 164, in <module>
fetch_data() #--- WORKS --- 3/20/12
File "cmpm.py", line 138, in fetch_data
select_date(driver, months)
File "cmpm.py", line 100, in select_date
select.select_by_visible_text("Jan 2018")
AttributeError: 'Select' object has no attribute 'select_by_visible_text'
C:\Users\Documents\NetBeansProjects\BudgetHome>
I have tried everything I have found thus far to make this work to no avail. Here is my existing code that worked:
from selenium.webdriver.support.ui import Select
months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
def select_date(driver, months): #NEED IT TO SELECT STARTDATE AND CHANGE IT TO JAN 2018 below works as of Feb 7th
for months in months:
elem = WebDriverWait(driver, wait_time).until(EC.presence_of_element_located((By.CSS_SELECTOR, 'button[name="btnSubmit"]')))
select = Select(driver.find_element_by_name('startdate'))
select.select_by_visible_text("Jan 2018")