scitex_browser.stealth
Stealth and anti-detection components.
- class scitex_browser.stealth.StealthManager(viewport_size=None, spoof_dimension=False)[source]
Bases:
object- get_network_evasion_headers()[source]
Generate realistic HTTP headers to avoid network-level detection.
- Return type:
- async handle_cloudflare_challenge_async(page, max_wait=45)[source]
Enhanced Cloudflare challenge detection and handling.
- get_dimension_spoofing_script()[source]
Generate comprehensive JavaScript dimension spoofing script for invisible browser mode.
This creates a dual-layer window configuration: - Physical window: 1x1 pixel (invisible to user) - Reported dimensions: 1920x1080 (natural desktop size for bot detection)
The script is bulletproof and handles all dimension-related APIs that bot detectors commonly check.
- Return type:
- class scitex_browser.stealth.HumanBehavior[source]
Bases:
objectSimulates human-like behavior patterns for browser automation.
- async random_delay_async(min_ms=1000, max_ms=3000, page=None)[source]
Add random delay to simulate human timing.
- Return type:
- async reading_delay_async(content_length=1000, page=None)[source]
Simulate time taken to read content based on length.
- Return type:
- async mouse_move_async(page, x=None, y=None)[source]
Move mouse to position with human-like movement.
- Return type:
- async hover_and_click_async(page, selector=None, element=None)[source]
Hover over element before clicking with human-like timing.
- Return type:
- async scroll_async(page, direction='down', distance=None)[source]
Scroll page with human-like behavior.
- Return type:
- async static type_text_async(page, selector=None, element=None, text='', clear_first=False)[source]
Type text with human-like timing and occasional mistakes.
- Return type:
- async static random_mouse_movement_async(page)[source]
Perform random mouse movements to appear active.
- Return type:
- async static pdf_viewing_behavior_async(page)[source]
Simulate human behavior when viewing a PDF.
- Return type: