Imperva¶
To import this module:
from python3_capsolver.imperva import Imperva
- class python3_capsolver.imperva.Imperva(captcha_type: AntiImpervaTaskEnm | str, websiteUrl: str, userAgent: str, *args, **kwargs)¶
The class is used to work with Capsolver Imperva method.
- Parameters:
api_key – Capsolver API key
captcha_type (AntiImpervaTaskEnm | str) – Captcha type name, like
AntiImpervaTask
and etc.websiteUrl (str) – The website url
userAgent (str) – Browser userAgent
Examples
>>> Imperva(api_key="CAI-BA9XXXXXXXXXXXXX2702E010", ... captcha_type="AntiImpervaTask", ... websiteUrl="https://www.milanuncios.com/", ... userAgent="Mozilla/5.0 (Windows ....", ... proxy="socks5:98.181.137.83:4145", ... utmvc=True, ... reese84=True, ... reeseScriptUrl="https://www.milanuncios.com/librarym.js", ... ).captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'token': '90F9EAF...'} )
>>> Imperva(api_key="CAI-BA9XXXXXXXXXXXXX2702E010", ... captcha_type=AntiImpervaTaskEnm.AntiImpervaTask, ... websiteUrl="https://www.milanuncios.com/", ... userAgent="Mozilla/5.0 (Windows ....", ... proxy="socks5:98.181.137.83:4145", ... utmvc=True, ... reese84=True, ... reeseScriptUrl="https://www.milanuncios.com/librarym.js", ... ).captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'token': '90F9EAF...'} )
>>> await Imperva(api_key="CAI-BA9650D2B9C2786B21120D512702E010", ... captcha_type=AntiImpervaTaskEnm.AntiImpervaTask, ... websiteUrl="https://www.milanuncios.com/", ... userAgent="Mozilla/5.0 (Windows ....", ... proxy="socks5:98.181.137.83:4145", ... utmvc=True, ... reese84=True, ... reeseScriptUrl="https://www.milanuncios.com/librarym.js", ... ).aio_captcha_handler() CaptchaResponseSer(errorId=0, errorCode=None, errorDescription=None, taskId='73bdcd28-6c77-4414-8....', status=<ResponseStatusEnm.Ready: 'ready'>, solution={'token': '90F9EAF...'} )
- Returns:
CaptchaResponseSer model with full server response
- captcha_handler() CaptchaResponseSer ¶
Sync solving method
- Returns:
CaptchaResponseSer model with full service response
- Return type:
CaptchaResponseSer
Notes
Check class docstring for more info
- async aio_captcha_handler() CaptchaResponseSer ¶
Async method for captcha solving
- Returns:
CaptchaResponseSer model with full service response
- Return type:
CaptchaResponseSer
Notes
Check class docstring for more info