This code is working. But it selected all dates from initial to 25. But I need only…
Jump to turn (6)
- 1This code is working. But it selected all dates from initial to 25. But I need o
- 2Maybe, unclear the initially selected date
- 3The code produces the desired output! How to select one more day to show date ra
- 4Unfortunately, calendar does not show the range from 25 to 27 of october, 2023.
- 5Do not use the right part
- 6It does not help. After the last part of code the 27th of September 2023 in the
- User
This code is working. But it selected all dates from initial to 25. But I need only select day 25
Configure Chrome WebDriver
driver = webdriver.Chrome()
Navigate to a specified page
driver.get("https://10.10.117.203/prod/ru/reports/finance_client_status")
Click on the calendar element
input_element = driver.find_element(By.CSS_SELECTOR, 'input.dates-container.form-control') input_element.click()
Find the left part of the calendar
start_calendar = driver.find_element(By.CSS_SELECTOR, '.drp-calendar.left') start_calendar.click()
wait = WebDriverWait(driver, 5) wait.until(expected_conditions.visibility_of_element_located((By.CSS_SELECTOR, '.drp-calendar.left')))
current_month = driver.find_element(By.CLASS_NAME,'monthselect').get_attribute('value') current_year = driver.find_element(By.CLASS_NAME,'yearselect').get_attribute('value')
while not(current_month.eq("9") and current_year.("2023")): driver.find_element(By.XPATH, "//th[@class='next available']").click() current_month = driver.find_element(By.CLASS_NAME,'monthselect').get_attribute('value') current_year = driver.find_element(By.CLASS_NAME,'yearselect').get_attribute('value')