I have been trying to automate checking hotel prices via the website www.trivago.ie I am struggling to select the dates from the calendar which pops up after you select a hotel.
I can't seem to get the correct class to allow me to select and update both the start and end date. I have attached my basic code below. Could someone please help me extend it such that I can select the dates after I have selected the hotel.
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
import time
options = webdriver.ChromeOptions()
options.add_argument("--start-maximized")
options.add_argument('window-size=2560,1440')
chrome_options = Options()
driver = webdriver.Chrome('*/drivers/chromedriver/win32/91.0.4472.101/chromedriver', chrome_options=options)
# Open the website page
driver.get('https://www.trivago.ie')
# Enter the hotel into the search box
driver.find_element_by_id("querytext").send_keys("test hotel")
# Allow time for options to populate
time.sleep(1)
# Select the first suggestion
driver.find_elements_by_class_name("ssg-suggestion__info")[0].click()
# Allow time for the calander to pop-up
time.sleep(3)
# Try, but fail, to select the date
#driver.find_elements_by_class_name("cal-day cal-is-weekend cal-is-selectable")[0].click()
driver.find_element_by_tag_name("cal-heading-month cal-heading-day4").click()
Any help would be much appreciated, I have hit quite the road-block. Thank you.
