I'm using python + selenium / undetected_chromedriver to crawl https://chat.openai.com/chat. But I need to click "verify you're a human".enter image description here

I follow the suggestion here: How to find the the CloudFlare human verification element using Selenium

from selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support import expected_conditions as ECfrom selenium import webdriverdriver = 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!

1

Best Answer


Using the following script:

import undetected_chromedriver as ucdriver = uc.Chrome()driver.get('https://chat.openai.com/chat')

worked for me. No capctha is shown.

If the issue still persists, you might try:

  • using Selenium-Profiles
  • using a proxy, in case you can't access the url from a regular browser (your ip got blocked). For example from asocks

Note: I am the developer of Selenium-Profiles