selecting date using selenium and python



  • I am automating the MakeMyTrip application for selecting a respective departure date. suppose I want to select 20 January 2020 how do I select

     driver.find_element_by_id("departure").click()
        month_from = driver.find_elements_by_xpath("//div[@class='DayPicker-Months']").text
        print(month_from)
    

    error:

    selenium.common.exceptions.ElementClickInterceptedException: Message: element click intercepted: Element is not clickable at point (822, 226). Other element would receive the click: ...

    enter image description here



  • There is an animation when you land the page. Before using the element, you have to wait for it to be clickable.

    element = WebDriverWait(driver, 20).until(
     EC.presence_of_element_located((By.ID, "departure")))
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2