My python program with selenium has a strange behavior : it works very good when I start it in debug mode but not in normal mode. The FromDate is not taken into account in normal mode.
I thought it was a timing problem and I put several wait (explicit and implicit wait) with no difference. Note that the button is a submit and not a click. Any Idea to solve this issue ?
url = "https://my.elexys.be/MarketInformation/SpotBelpex.aspx"
driver = webdriver.Chrome()
driver.get(url)
FromDate = driver.find_element("name", "ctl00$contentPlaceHolder$fromASPxDateEdit")
FromDate.clear()
FromDate.send_keys("01/11/2023")
UntilDate = driver.find_element("name", "ctl00$contentPlaceHolder$untilASPxDateEdit")
UntilDate.clear()
UntilDate.send_keys("01/12/2023")
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.NAME, "ctl00$contentPlaceHolder$refreshBelpexCustomButton")))
ShowData_button = driver.find_element("name", "ctl00$contentPlaceHolder$refreshBelpexCustomButton")
ShowData_button.submit()
driver.page_source. Maybe server sends different content - ie. some warning or captcha.