Skip to content

Instantly share code, notes, and snippets.

@alperensert
Created July 30, 2023 19:22
Show Gist options
  • Save alperensert/d5728cce7ad16ff5c61a0d1d68aae320 to your computer and use it in GitHub Desktop.
Save alperensert/d5728cce7ad16ff5c61a0d1d68aae320 to your computer and use it in GitHub Desktop.
Bypass ReCaptcha V3 with Selenium & CapSolver
import os
import time
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
def main():
current_working_directory = os.getcwd()
capsolver_extension_path = current_working_directory + "/capsolver_extension"
chrome_driver_path = current_working_directory + "/chromedriver"
chrome_service = Service(executable_path=chrome_driver_path)
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(f"--load-extension={capsolver_extension_path}")
driver = webdriver.Chrome(service=chrome_service, options=chrome_options)
driver.get("https://antcpt.com/score_detector/")
wait = WebDriverWait(driver, timeout=100)
time.sleep(10)
wait.until(EC.presence_of_element_located(
(By.CSS_SELECTOR, "#captcha-solver-tip-button > div.captcha-solver-info")))
wait.until_not(EC.text_to_be_present_in_element(
(By.CSS_SELECTOR, "#captcha-solver-tip-button > div.captcha-solver-info"), "Solving..."))
driver.execute_script("scoreCheck()")
time.sleep(20)
driver.quit()
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment