始皇,求求怎么过Turnstile

啊,一直卡在 Turnstile

我是py
import undetected_chromedriver as uc
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

username = ' '
password = ' '
another_username = '[email protected]'  # Replace with the actual username
another_password = 'password'          # Replace with the actual password

# Setup undetected Chromedriver
options = uc.ChromeOptions()
# options.add_argument("--headless")  # Uncomment if you want to run headless
driver = uc.Chrome(options=options)

# Navigate to the login page
driver.get("https://token.oaifree.com/auth")

# Login process
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.ID, "login-account-name"))).send_keys(username)
driver.find_element(By.ID, "login-account-password").send_keys(password + Keys.RETURN)

# Wait for and click some button (example with class name)
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, "//a[contains(@class, 'bg-red-500')]"))).click()

# Wait for new form and enter another username
WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.ID, "txtUsername"))).send_keys(another_username)

# Enter another password
driver.find_element(By.ID, "txtPassword").send_keys(another_password)

# Check the checkbox
checkbox = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "input[type='checkbox']")))
checkbox.click()

# Wait for success circle to be clickable and click the get access token button
WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.CSS_SELECTOR, "circle.success-circle")))
driver.find_element(By.ID, "btnGetAccessToken").click()

4 Likes

用DrissionPage

2 Likes

你都用selenium了,再写个点击就好了

用这个好像还是会检测出来,通过不了

@neo

常规话题快问快答

1 Like

好家伙,我攻击我自己?

3 Likes

就是求始皇指条明路,有apikey一个

你知道我有多少apikey 吗 :yum:

1 Like

From #develop:qa to 开发调优

1 Like