So I am having problems with my code. Everytime i run it, I cannot click on the 'Accept Cookies'Button on the tiktok page I am trying to access. It simply just gives me a Timeoutexception error.
from selenium import webdriver
import time
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import chromedriver_autoinstaller
from selenium_stealth import stealth
chromedriver_autoinstaller.install()
driver = webdriver.Chrome()
driver.get('https://www.tiktok.com/tag/reizen?lang=en')
WebDriverWait(driver,20).until(EC.frame_to_be_available_and_switch_to_it((By.XPATH, "/html/body/tiktok-cookie-banner//div")))
WebDriverWait(driver,20).until(EC.element_to_be_clickable((By.XPATH,"/html/body/tiktok-cookie-banner//div/div[2]"))).click()
I am not sure where the problem is.
Many thanks!