-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolve_from_url.py
More file actions
34 lines (24 loc) · 835 Bytes
/
Copy pathsolve_from_url.py
File metadata and controls
34 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Example: Solve CAPTCHA from URL
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This example demonstrates how to solve a CAPTCHA image directly from a URL.
"""
from fastcaptcha import FastCaptcha
def main():
# Initialize the solver
api_key = "your-api-key-here" # Replace with your actual API key
solver = FastCaptcha(api_key=api_key)
# CAPTCHA image URL
captcha_url = "https://example.com/captcha.png" # Replace with actual URL
try:
# Solve CAPTCHA from URL
print(f"Solving CAPTCHA from URL: {captcha_url}")
result = solver.solve_url(captcha_url)
# Print result
print(f"✓ Solved! CAPTCHA text: {result}")
except Exception as e:
print(f"✗ Error: {e}")
finally:
solver.close()
if __name__ == "__main__":
main()