I am trying to get the fares for all combinations of stations in Metro-North using Selenium in Python. I wanted to go to their fare page, put station names into the select fields, click on the fare button, and then copy the needed values to the dataframe.
I tried all possible options to select stations from the dropdown menu but nothing works as I get the error: ElementNotInteractableException
.
The code I tried:
driver = webdriver.Safari()
driver.get('http://as0.mta.info/mnr/schedules/sched_form.cfm')
select = Select(driver.find_element_by_id('Vorig_station'))
print([o.text for o in select.options])
time.sleep(3)
select.select_by_visible_text('ANSONIA')
element = driver.find_element_by_xpath('//*[@id="frmindex"]/table[2]/tbody/tr[6]/td/input[2]')
element.click()
driver.close()
print command shows the options but I cannot choose and go to the next fares page.
Help please!