AmazonWAF¶
To import this module:
from python3_anticaptcha.amazon_waf import AmazonWAF
- class python3_anticaptcha.amazon_waf.AmazonWAF(api_key: str, captcha_type: CaptchaTypeEnm | str, websiteURL: str, websiteKey: str, iv: str, context: str, proxyType: ProxyTypeEnm | str | None = None, proxyAddress: str | None = None, proxyPort: int | None = None, proxyLogin: str | None = None, proxyPassword: str | None = None, userAgent: str | None = None, sleep_time: int | None = 10)¶
- __init__(api_key: str, captcha_type: CaptchaTypeEnm | str, websiteURL: str, websiteKey: str, iv: str, context: str, proxyType: ProxyTypeEnm | str | None = None, proxyAddress: str | None = None, proxyPort: int | None = None, proxyLogin: str | None = None, proxyPassword: str | None = None, userAgent: str | None = None, sleep_time: int | None = 10)¶
The class is used to work with FunCaptcha.
- Parameters:
api_key (str) – Capsolver API key
captcha_type (CaptchaTypeEnm | str) – Captcha type
websiteURL (str) – Address of a target web page. Can be located anywhere on the web site, even in a member area
websiteKey (str) – Value of key from window.gokuProps object in WAF page source code
iv (str) – Value of iv from window.gokuProps object in WAF page source code
context (str) – Value of context from window.gokuProps object in WAF page source code
proxyType (ProxyTypeEnm | str | None) – Type of the proxy
proxyAddress (str | None) – Proxy IP address IPv4/IPv6. Not allowed to use: host names instead of IPs, transparent proxies (where client IP is visible), proxies from local networks (192.., 10.., 127…)
proxyPort (int | None) – Proxy port.
proxyLogin (str | None) – Proxy login.
proxyPassword (str | None) – Proxy password.
userAgent (str | None) – Browser UserAgent.
sleep_time (int | None) – The waiting time between requests to get the result of the Captcha
Examples
>>> AmazonWAF(api_key="99d7d111a0111dc11184111c8bb111da", ... captcha_type="AmazonTaskProxyless", ... websiteURL="https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest", ... websiteKey="AQIDAgghr5y45ywZwdADFLWk7XOA==", ... iv="CgAAXFFFFSAAABVk", ... context="qoJYgnKscdqwdqwdqwaormh/dYYK+Y=", ... ).captcha_handler() { "errorId": 0, "errorCode": None, "errorDescription": None, "status":"ready", "solution":{ "token":"0.Qz0.....f1" }, "cost": 0.002, "ip": "46.53.249.230", "createTime": 1679004358, "endTime": 1679004368, "solveCount": 0, "taskId": 396687629 }
>>> await AmazonWAF(api_key="99d7d111a0111dc11184111c8bb111da", ... captcha_type="AmazonTaskProxyless", ... websiteURL="https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest", ... websiteKey="AQIDAgghr5y45ywZwdADFLWk7XOA==", ... iv="CgAAXFFFFSAAABVk", ... context="qoJYgnKscdqwdqwdqwaormh/dYYK+Y=", ... ).aio_captcha_handler() { "errorId": 0, "errorCode": None, "errorDescription": None, "status":"ready", "solution":{ "token":"0.Qz0.....f1" }, "cost": 0.002, "ip": "46.53.249.230", "createTime": 1679004358, "endTime": 1679004368, "solveCount": 0, "taskId": 396687629 }
>>> AmazonWAF(api_key="99d7d111a0111dc11184111c8bb111da", ... captcha_type="AmazonTaskProxyless", ... websiteURL="https://efw47fpad9.execute-api.us-east-1.amazonaws.com/latest", ... websiteKey="AQIDAgghr5y45ywZwdADFLWk7XOA==", ... iv="CgAAXFFFFSAAABVk", ... context="qoJYgnKscdqwdqwdqwaormh/dYYK+Y=", ... proxyType="http", ... proxyAddress="0.0.0.0", ... proxyPort=9988, ... proxyLogin="proxy_login", ... proxyPassword="proxy_password", ... userAgent="some_real_user_agent", ... ).captcha_handler() { "errorId": 0, "errorCode": None, "errorDescription": None, "status":"ready", "solution":{ "token":"0.Qz0.....f1" }, "cost": 0.002, "ip": "46.53.249.230", "createTime": 1679004358, "endTime": 1679004368, "solveCount": 0, "taskId": 396687629 }