I'm using python + selenium / undetected_chromedriver to crawl https://chat.openai.com/chat. But I need to click "verify you're a human".
I follow the suggestion here: How to find the the CloudFlare human verification element using Selenium
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium import webdriver
driver = webdriver.Chrome(chromedriver)
driver.get('https://chat.openai.com/chat')
time.sleep(10)
element = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.CSS_SELECTOR, "label.ctp-checkbox-label span.mark")))
#element = WebDriverWait(driver, 20).until(EC.visibility_of_element_located((By.XPATH, "//label[@class='ctp-checkbox-label']//span[@class='mark']")))
print(element)
time.sleep(5)
driver.quit()
But it looks like this script cannot find the element, and always has error: selenium.common.exceptions.TimeoutException:
Could anyone provide a solution? What's the next step then, i.e., element.click(), to click on the checkbox?? Thanks!