I'm using Selenium in a Python script to query NASA's Small Body Database for the location of asteroids. I've been working with a Python shell to check that my commands are getting the results I want, but I'm having a consistent issue with the "submit" method.
The page I'm working on is https://ssd.jpl.nasa.gov/sbwobs.cgi. All I want to do is have Selenium click on the "change" link next to "Observation Time," fill in a field on the page that opens, and then click the resulting "Use Specified Time" button.
I've set up a Selenium WebDriver object named "browser", and then the first command I send is:
browser.find_element_by_css_selector("a[href*='time']").click()
Which works and sends me to my target page, which is https://ssd.jpl.nasa.gov/sbwobs.cgi?s_time=1#top
I then find the text field and fill it in with:
browser.find_element_by_name('obs_time').send_keys("2021-04-01 01:00")
... last thing I need is to click the "Use Specified Time" button to accept this. I tried with:
browser.find_element_by_name("check_time").click()
.. but this had no response. Then I tried:
browser.find_element_by_name("check_time").submit()
... which seems to work, but takes me back to the previous page without actually changing the time. If I manually click on the button it would work fine.
Selenium is definitely finding the right element, and the submit
method is doing something, but it's maybe not sending the info in the text box correctly.
I don't know anywhere near enough about HTML etc to be able to figure this out. Can anyone offer any advice?