I am trying to click an element using selenium chromedriver by the Use of ID of an element to click.
I want to Click Year '2020" from the following webpage: 'https://www.satp.org/datasheet-terrorist-attack/major-incidents/Pakistan'
I tried with the below code.
driver = webdriver.Chrome(executable_path=ChromeDriver_Path, options = options) driver.get('https://www.satp.org/datasheet-terrorist-attack/major-incidents/Pakistan') Id = "ctl00_ContentPlaceHolder1_gvMajorIncident_ct123_lbtnYear" ### Id of an Element 2020 wait = WebDriverWait(driver, 20) ##Wait for 20 seconds element = wait.until(EC.element_to_be_clickable((By.ID, Id))) driver.execute_script("arguments[0].scrollIntoView();", element) element.click() time.sleep(10)
but unfortunately this gives an Error as below:
element = wait.until(EC.element_to_be_clickable((By.ID, Id))) File "C:\Users\Pavan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message:
Please anyone help me on this... Thanks;