
⚙️ Prerequisites
- Proxy (Optional)
- Python installed
- Capsolver API key
🤖 Step 1: Install Necessary Packages
Execute the following commands to install the required packages:
pip install capsolver
👨💻 Python Code for bypass hCaptcha with your own proxy
Here's a Python sample script to accomplish the task:
import capsolver
# Consider using environment variables for sensitive information
PROXY = "http://username:password@host:port"
capsolver.api_key = "YourPayPerUsage Key"
PAGE_URL = ""
PAGE_KEY = ""
def solve_hcaptcha(url,key):
solution = capsolver.solve({
"type": "HCaptchaTask",
"websiteURL": url,
"websiteKey":key,
"proxy": PROXY
})
return solution
def main():
print("Solving hCaptcha...")
solution = solve_hcaptcha(PAGE_URL, PAGE_KEY)
print("Solution: ", solution)
if __name__ == "__main__":
main()
👨💻 Python Code for bypass hCaptcha without proxy
Here's a Python sample script to accomplish the task:
import capsolver
import requests
# Consider using environment variables for sensitive information
capsolver.api_key = "YourPayPerUsage Key"
PAGE_URL = ""
PAGE_KEY = ""
def solve_hcaptcha(url,key):
solution = capsolver.solve({
"type": "HCaptchaTaskProxyless",
"websiteURL": url,
"websiteKey":key
})
return solution
def main():
print("Solving hCaptcha...")
solution = solve_hcaptcha(PAGE_URL, PAGE_KEY)
print("Solution: ", solution)
if __name__ == "__main__":
main()
⚠️ Change these variables
- PROXY: Update with your proxy details. The format should be http://username:password@ip:port. Only required if use HCaptchaTask
- capsolver.api_key: Obtain your API key from the Capsolver Dashboard.
- PAGE_URL: Replace with the URL of the website for which you wish to bypass hcaptcha captcha