Hello all I am trying to practice selenium with python on the following website booking.com in that I want to click an element where in can select on the next month. I have tried to write the xpath for it which is even valid when checked on chrome console. however it does not click on the next arrow below is the snapshot wherein i want to click on the next arrow and console pic for your reference. Can you please tell me where i am going wrong on this
from selenium import webdriver import time from selenium.webdriver.common.by import By driver = webdriver.Chrome(executable_path='C:\chromedriver') driver.get("https://www.booking.com/") time.sleep(4) driver.maximize_window() time.sleep(2) #place to add the destination location driver.find_element(By.XPATH, "//input[@placeholder='Where are you going?']").send_keys("Jaisalmer") time.sleep(5) #location name select driver.find_element(By.XPATH, ".//*[contains(@data-label,'Suryagarh ')]").click() time.sleep(3) driver.find_element(By.CLASS_NAME, "sb-date-field__icon sb-date-field__icon-btn bk-svg-wrapper calendar-restructure-sb").click() time.sleep(6) driver.execute_script("window.scrollTo(24,document.body.scrollHeight);") nextbutton = driver.find_element(By.XPATH, "//div[@class='bui-calendar__control bui-calendar__control--next']").click() #for i in range(3): #nextbutton.click() time.sleep(4) driver.quit() 