The library is intended for software developers and serves to facilitate the work with the RuCaptcha service API.
There are examples of working with the library.
Python version 3.6+ is used.
How to install? How to install?
pip
Source
Captcha image solution (large and small).
Documentation https://github.com/AndreiDrang/python-rucaptcha
There are examples of working with the library.
Python version 3.6+ is used.
How to install? How to install?
pip
pip install python-rucaptcha
Source
Code:
git clone https://github.com/AndreiDrang/python-rucaptcha.git
cd python-rucaptcha
python setup.py install
Code:
from python_rucaptcha import ImageCaptcha
# Enter the key from the RuCaptcha service from your account
RUCAPTCHA_KEY = ""
# Link to images for decryption
image_link = ""
# Returns JSON containing information for solving the captcha
user_answer = ImageCaptcha.ImageCaptcha (rucaptcha_key = RUCAPTCHA_KEY) .captcha_handler (captcha_link = image_link)
if not user_answer ['error']:
#captcha solution
print (user_answer ['captchaSolve'])
print (user_answer ['taskId'])
elif user_answer ['error']:
# Error body, if any
print (user_answer ['errorBody'])
print (user_answer ['errorBody'])