feature!: добавлен обход claudflare

не кликает!
This commit is contained in:
protokey committed 2026-09-22 18:56:50 +04:00
1 parent 40e5d046a9
commit f1ed6edc7a
12 files changed
+171 -64

No files matched your search

+18
View File
@@ -31,10 +31,28 @@ page.click()) телепортирует курсор мгновенно и та
"""
import random
import string
from typing import Optional
from playwright.async_api import TimeoutError
from playwright.async_api import Page
async def wait_for_networkidle(page: Page, timeout: Optional[int] = None):
"""Wait for the page to become idle (no network activity) even if there are never-ending requests."""
try:
await page.wait_for_load_state("networkidle", timeout=timeout)
except TimeoutError:
pass
async def wait_for_page_stability(page: Page, load_dom: bool, network_idle: bool):
await page.wait_for_load_state(state="load")
if load_dom:
await page.wait_for_load_state(state="domcontentloaded")
if network_idle:
await wait_for_networkidle(page)
async def typing(page: Page, locator: str, text: str):
element = page.locator(locator)