AsyncElement (dendrite_element.py)

dendrite-python-sdk · scraping, playwright-automation, element-interaction, async, navigation-tracking

Wraps Playwright's async element locator to perform browser interactions like clicks and text input with navigation tracking and outcome validation for web scraping.

# Source: https://github.com/nerdy-tech-com-gitub/dendrite-python-sdk | License: MIT | Copyright 2024 Dendrite Systems
# Provided via justclaw.it.com; keep this notice with the code.
from __future__ import annotations
import asyncio
import base64
import functools
import time
from typing import TYPE_CHECKING, Optional

from loguru import logger
from playwright.async_api import Locator

from dendrite.async_api._api.browser_api_client import BrowserAPIClient
from dendrite._common._exceptions.dendrite_exception import IncorrectOutcomeError

if TYPE_CHECKING:
    from dendrite.async_api._core.dendrite_browser import AsyncDendrite
from dendrite.async_api._core._managers.navigation_tracker import NavigationTracker
from dendrite.async_api._core.models.page_diff_information import (
    PageDiffInf

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search 40K more like it.

Get a free API key