Git Product home page Git Product logo

andreidrang / python3-capsolver Goto Github PK

View Code? Open in Web Editor NEW
47.0 47.0 5.0 2.51 MB

Python library for Capsolver

Home Page: https://andreidrang.github.io/python3-capsolver/

License: MIT License

Makefile 0.53% Python 99.47%
akamai binance capsolver capsolvercom captcha captcha-api captcha-solving captchaai datadome-captcha funcaptcha geetest geetest-captcha hcaptcha image-captcha imperva mtcaptcha python3 recaptcha recaptcha-v2 recaptcha-v3

python3-capsolver's Introduction

python3-capsolver's People

Contributors

andreidrang avatar dependabot[bot] avatar podzied avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

python3-capsolver's Issues

allow_population_by_field_name warning

A brief description of the problem.

  1. Library version: 0.9.2
  2. Operating system: Windows 11
  3. Full description of the problem:

My program shows this warning:

/home/autologin/.venv/lib/python3.11/site-packages/pydantic/_internal/_config.py:317: UserWarning: Valid config keys have changed in V2:
* 'allow_population_by_field_name' has been renamed to 'populate_by_name'

allow_population_by_field_name is being used in this line.

Keep getting errors returning the token

Not sure what im doing here- I can print the token but im having issues sending it back to the server.

iframe = WebDriverWait(driver, 10).until(
    EC.presence_of_element_located((By.XPATH, '//iframe[@title="reCAPTCHA"]'))
)

driver.switch_to.frame(iframe)
print("Inside reCAPTCHA iframe...")

# Solve the captcha and capture the token (adjust this part according to your library's documentation)
captcha_solver = ReCaptcha(api_key="",
                           captcha_type="ReCaptchaV2Task",
                           websiteURL="",
                           websiteKey="",
                           proxy=proxy)
captcha_token = captcha_solver.captcha_handler()  # Assuming this returns the token

print(captcha_token)

# Switch back to the main content if you were inside an iframe
driver.switch_to.default_content()

# Assuming captcha_token is an object and has a 'gRecaptchaResponse' attribute
token_string = captcha_token.gRecaptchaResponse

# Safely convert the token_string to a JavaScript string
import json
safe_captcha_token = json.dumps(token_string)

# Find the textarea element
textarea = driver.find_element(By.ID, "g-recaptcha-response")

# Execute the JavaScript code to insert the CAPTCHA token into the textarea
driver.execute_script(f"arguments[0].value = {safe_captcha_token};", textarea)

# Wait for the element with the specified XPath to have the attribute aria-checked="true"
wait.until(EC.presence_of_element_located((By.XPATH, '//*[@id="recaptcha-anchor" and @aria-checked="true"]')))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.