Skip to main content
A union type representing different methods to trigger file downloads in web automation. This type alias standardizes how download operations can be initiated, providing multiple approaches to suit different automation scenarios.
type Trigger = str | Locator | Callable[[Page], None] | Callable[[Page], Awaitable[None]]
Type Information:
  • str: Direct URL string to download from
  • Locator: Playwright Locator object pointing to a clickable download element
  • Callable[[Page], None] | Callable[[Page], Awaitable[None]]: Custom async function that takes a Page and triggers the download

Examples

from typing import TypedDict
from playwright.async_api import Page
from intuned_browser import download_file
class Params(TypedDict):
    pass
async def automation(page: Page, params: Params, **_kwargs):
    # Direct download from URL
    download = await download_file(
        page,
        trigger="https://intuned-docs-public-images.s3.amazonaws.com/32UP83A_ENG_US.pdf"
    )