Initialize a reCognizer AsyncChallenger instance with specified configurations. Args: page (Page): The Playwright Page to initialize on. click_timeout (int, optional): Click Timeouts between captcha-clicks. retry_times (int, optional): Maximum am
(
self,
page: Union[PlaywrightPage, PatchrightPage],
click_timeout: Optional[int] = None,
retry_times: int = 15,
optimize_click_order: Optional[bool] = True,
)
| 44 | |
| 45 | class SyncChallenger: |
| 46 | def __init__( |
| 47 | self, |
| 48 | page: Union[PlaywrightPage, PatchrightPage], |
| 49 | click_timeout: Optional[int] = None, |
| 50 | retry_times: int = 15, |
| 51 | optimize_click_order: Optional[bool] = True, |
| 52 | ) -> None: |
| 53 | """ |
| 54 | Initialize a reCognizer AsyncChallenger instance with specified configurations. |
| 55 | |
| 56 | Args: |
| 57 | page (Page): The Playwright Page to initialize on. |
| 58 | click_timeout (int, optional): Click Timeouts between captcha-clicks. |
| 59 | retry_times (int, optional): Maximum amount of retries before raising an Exception. Defaults to 15. |
| 60 | optimize_click_order (bool, optional): Whether to optimize the click order with the Travelling Salesman Problem. Defaults to True. |
| 61 | """ |
| 62 | self.page: Union[PlaywrightPage, PatchrightPage] = page |
| 63 | self.routed_page = False |
| 64 | self.detector = Detector(optimize_click_order=optimize_click_order) |
| 65 | |
| 66 | self.click_timeout = click_timeout |
| 67 | self.retry_times = retry_times |
| 68 | self.retried = 0 |
| 69 | |
| 70 | self.dynamic: bool = False |
| 71 | self.captcha_token: Optional[str] = None |
| 72 | |
| 73 | def route_handler( |
| 74 | self, |