I am trying to pick a date in this website: https://www.myrealtrip.com/offers/21989
The code I have so far is:
option = selenium.webdriver.ChromeOptions()
option.add_argument(" - incognito")
browser = webdriver.Chrome(executable_path=r"chromedriver.exe")
browser.get('https://www.myrealtrip.com/offers/21989')
calendar = browser.find_element_by_name('.find_element_by_xpath('//*[@id="calendarBtn"]/input')')
date = 2018-04-14, 토요일
calendar2.send_keys(date)
The last line gives an error:
selenium.common.exceptions.InvalidElementStateException: Message: invalid element state
When is it appropriate to use send_key? calendar2 is an object of type WebElement, and so I thought it might work.
Can someone help me? I've also tried clicking on the calendar and clicking on the specific date but found the layout very confusing.