scitex_browser.interaction
- async scitex_browser.interaction.click_center_async(page, verbose=False, func_name='click_center_async')[source]
Click the center of the viewport.
- Parameters:
page – Playwright page object
verbose (
bool) – Enable visual feedback (default False)
- Returns:
Click result
- async scitex_browser.interaction.click_with_fallbacks_async(page, selector, method='auto', verbose=False, capture_debug=True)[source]
Click element using multiple fallback methods.
- Parameters:
page (
Page) – Playwright page objectselector (
str) – CSS selector for the elementmethod (
str) – Click method (“auto”, “playwright”, “force”, “js”)verbose (
bool) – Enable visual feedback via popup system (default False)capture_debug (
bool) – Save screenshot+HTML before/after the click (default True). Disabled in tight loops or hot paths where artifact volume hurts.
- Returns:
True if click successful, False otherwise
- Return type:
- async scitex_browser.interaction.fill_with_fallbacks_async(page, selector, value, method='auto', verbose=False, capture_debug=True)[source]
Fill element using multiple fallback methods.
- Parameters:
page (
Page) – Playwright page objectselector (
str) – CSS selector for the elementvalue (
str) – Value to fillmethod (
str) – Fill method (“auto”, “playwright”, “type”, “js”)verbose (
bool) – Enable visual feedback via popup system (default False)capture_debug (
bool) – Save screenshot+HTML before/after the fill (default True). Disabled in tight loops or hot paths.
- Returns:
True if fill successful, False otherwise
- Return type:
- class scitex_browser.interaction.PopupHandler(page)[source]
Bases:
objectHandle various types of popups on web pages.
- COOKIE_SELECTORS = ['button#onetrust-accept-btn-handler', 'button#onetrust-pc-btn-handler', 'button[id*="accept-cookie"]', 'button[id*="accept-all"]', 'button[aria-label*="accept cookie"]', 'button[aria-label*="Accept cookie"]', 'button:has-text("Accept all")', 'button:has-text("Accept All")', 'button:has-text("I agree")', 'button:has-text("I Agree")', 'button:has-text("Accept")', '.cookie-notice button.accept', '[class*="cookie"] button[class*="accept"]']
- CLOSE_SELECTORS = ['button[aria-label="Close"]', 'button[aria-label="close"]', 'button[aria-label*="Close"]', 'button[aria-label*="close"]', 'button[aria-label*="dismiss"]', 'button[aria-label*="Dismiss"]', 'button.close', 'button.close-button', 'button.modal-close', 'button.popup-close', 'button.dialog-close', 'a.close', 'a.close-button', 'span.close', '[class*="close-button"]', '[class*="close-icon"]', 'svg[class*="close"]', 'button:has-text("No thanks")', 'button:has-text("No Thanks")', 'button:has-text("Maybe later")', 'button:has-text("Maybe Later")', 'button:has-text("Skip")', 'button:has-text("Dismiss")', 'button:has-text("Not now")', 'button:has-text("Not Now")']
- MODAL_SELECTORS = ['.modal', '.overlay', '[role="dialog"]', '.popup', '#onetrust-banner-sdk', '.onetrust-pc-dark-filter', '[class*="modal"]', '[class*="popup"]', '[class*="overlay"]', '[class*="dialog"]', '[class*="banner"]', 'div[aria-modal="true"]']
- async handle_cookie_popup()[source]
Handle cookie consent popups.
- Return type:
- Returns:
True if handled, False otherwise
- async scitex_browser.interaction.close_popups_async(page, handle_cookies=True, close_others=True, max_attempts=3, wait_first=True, wait_ms=2000)[source]
Convenience function to handle all popups on a page.
- Parameters:
page (
Page) – Playwright page objecthandle_cookies (
bool) – Whether to accept cookie popupsclose_others (
bool) – Whether to close other popupsmax_attempts (
int) – Maximum attempts to clear popupswait_first (
bool) – Whether to wait for popups to appear firstwait_ms (
int) – Time to wait for popups to appear
- Return type:
- Returns:
Tuple of (number handled, list of handled popups)