Imperva (Incapsula)

To import this module:

from python_rucaptcha.incapsula_captcha import IncapsulaCaptcha
from python_rucaptcha.core.enums import IncapsulaEnm
class python_rucaptcha.incapsula_captcha.IncapsulaCaptcha(websiteURL: str, incapsulaScriptUrl: str, incapsulaCookies: str, proxyType: str, proxyAddress: str, proxyPort: int, method: str | IncapsulaEnm = IncapsulaEnm.IncapsulaTask, userAgent: str | None = None, reese84UrlEndpoint: str | None = None, proxyLogin: str | None = None, proxyPassword: str | None = None, *args, **kwargs)

Solve the cookie-based Imperva (Incapsula) captcha.

__init__(websiteURL: str, incapsulaScriptUrl: str, incapsulaCookies: str, proxyType: str, proxyAddress: str, proxyPort: int, method: str | IncapsulaEnm = IncapsulaEnm.IncapsulaTask, userAgent: str | None = None, reese84UrlEndpoint: str | None = None, proxyLogin: str | None = None, proxyPassword: str | None = None, *args, **kwargs)
Parameters:
  • rucaptcha_key – User API key.

  • websiteURL (str) – Full URL of the page where Incapsula is loaded.

  • incapsulaScriptUrl (str) – Incapsula JavaScript resource URL or name.

  • incapsulaCookies (str) – Cookies received from the Incapsula challenge page.

  • proxyType (str) – Proxy type: http, socks4 or socks5.

  • proxyAddress (str) – Proxy IP address or hostname.

  • proxyPort (int) – Proxy port.

  • method (str | IncapsulaEnm) – Captcha task type. Only IncapsulaTask is supported.

  • userAgent (str | None) – Optional browser User-Agent.

  • reese84UrlEndpoint (str | None) – Optional Reese84 fingerprint endpoint.

  • proxyLogin (str | None) – Optional proxy login.

  • proxyPassword (str | None) – Optional proxy password.

  • kwargs – Additional task parameters.

captcha_handler(**kwargs) dict

Synchronously submit and poll the Incapsula task.

async aio_captcha_handler() dict

Asynchronously submit and poll the Incapsula task.

Provide the Incapsula script resource and cookies captured from the challenge page. The optional reese84UrlEndpoint is the endpoint used to submit the Reese84 fingerprint. Keep the same proxy session while solving and using the returned cookies.

Cookies are returned under solution.domains[domain].cookies. Reuse any User-Agent included in the solution headers when making the target request.