Web Browsing

Native Apple WebKit browser with 42 actions — navigate, interact, extract content, fill forms, scrape, and automate web pages.

Yukkai includes a built-in web browser powered by native Apple WebKit — the same engine as Safari. With 42 actions covering navigation, interaction, content extraction, tab management, sessions, anti-detection, media handling, and pre-built scraping recipes, it can handle everything from simple page reads to complex multi-page automation flows.

Why WebKit?

  • Native & lightweight: ~50 MB RAM per tab. No Electron, no dependencies.
  • Real Safari User-Agent: Natural anti-bot fingerprint — sites see a genuine Safari browser.
  • Full JavaScript support: SPAs, React, Vue, and dynamic content all work perfectly.
  • Cookies persist across navigations within a session.


Actions Reference

Navigation

Action Description
navigate Load a URL. Returns an indexed DOM tree. Handles redirects. Timeout: 60s.
back Go back in browser history.
forward Go forward in browser history.
wait Wait for the page to stabilize (timeout in ms).

Interaction

Action Description
click Click an element by its DOM index.
input_text Type text into an element by index (clears the field first).
select_option Select a dropdown option by index and value.
send_keys Send keyboard keys (Enter, Escape, Tab, Backspace, or text).
scroll Scroll the page (direction: up/down/left/right, pages: N).

Content Extraction

Action Description
extract Get the full page content as clean, structured Markdown.
search_page Find text matches on the current page (fast, free).
screenshot Capture the page as a PNG (saved to ~/YukkaiDocs/).
evaluate Run arbitrary JavaScript and return the result.

Tab Management

Action Description
get_tabs List all open tabs with their IDs.
new_tab Create a new tab (optionally with a URL).
switch_tab Switch to a tab by its tab_id.
close_tab Close a tab by its tab_id.

Cookies & Window

Action Description
cookies Get session cookies (optionally filtered by domain).
show Open a visible browser window the user can see and interact with.
hide Close the visible browser window.

Sessions (Persistent Login)

Action Description
save_session Save all cookies to disk (session_name required).
load_session Restore previously saved cookies (session_name required).
list_sessions List all saved sessions.
delete_session Delete a saved session (session_name required).
clear_data Clear all cookies and cache.

Advanced Wait Actions

Action Description
wait_for_selector Wait for a CSS selector to appear (params: selector, timeout).
wait_for_text Wait for specific text to appear on the page (params: text, timeout).
wait_for_network_idle Wait for all fetch/XHR requests to complete (param: timeout).
wait_for_dom_change Wait for DOM content to change (params: selector, timeout).

Infinite Scroll

Action Description
scroll_and_collect Scroll the page and collect elements. Params: selector, max_items (default 100), scroll_pause (default 1500ms), extract_js (custom extraction code).

Human-Like Behavior (Anti-Detection)

Action Description
human_click Natural click with mouse movement and delays.
human_type Character-by-character typing with natural timing.
human_scroll Organic scroll with variable speed.

Media

Action Description
collect_media List all images/videos on the page (optional URL filter).
download_media Download a specific media URL (params: url, optional filename).
download_all_media Download all media matching a filter (params: filter, max_items_media default 50).

Data Export

Action Description
export_data Export data to a file (params: data as JSON string, format: json/csv/markdown, filename).

Request Interceptor

Action Description
start_interceptor Start capturing fetch/XHR requests (param: url_pattern to filter).
get_intercepted Retrieve captured requests (param: clear: true to reset).
stop_interceptor Stop capturing.

Scraping Recipes

Action Description
recipe Run a pre-built scraping recipe (params: recipe_name, target).
list_recipes List available recipes.

Available recipes: google_search, github_repo, github_trending, hackernews, reddit, twitter, youtube_search, wikipedia, amazon_search, linkedin_company.


DOM Tree Format

When you navigate to a page, Yukkai returns an indexed DOM tree (Browser Use format):

[0]<nav />
    [1]<a href="/" />
        Home
    [2]<a href="/about" />
        About
[3]<main />
    [4]<input type=search placeholder="Search..." />
    [5]<button />
        Go

Only interactive elements get an [index]. Use this index to click or input text. For example, to fill the search field above and click the button:

web_browse(action: "input_text", index: 4, text: "AI agents")
web_browse(action: "click", index: 5)

Examples

Read a Web Page

web_browse(action: "navigate", url: "https://example.com")
web_browse(action: "extract")

Fill a Search Form

web_browse(action: "navigate", url: "https://google.com")
web_browse(action: "input_text", index: 4, text: "AI agents")
web_browse(action: "click", index: 5)
web_browse(action: "extract")

Scrape with a Recipe

web_browse(action: "recipe", recipe_name: "hackernews", target: "frontpage")

Save & Restore a Login Session

// First time: log in manually or via automation, then save
web_browse(action: "save_session", session_name: "github")

// Later: restore and continue
web_browse(action: "load_session", session_name: "github")
web_browse(action: "navigate", url: "https://github.com/dashboard")

Open a Visible Browser for the User

web_browse(action: "show", url: "https://apple.com")

Scroll and Collect Items

web_browse(action: "scroll_and_collect", selector: ".article-card", max_items: 50, scroll_pause: 2000)

Tips

  • Prefer extract over screenshot for reading content — Markdown output is structured and searchable.
  • Use wait_for_selector after clicking buttons that trigger dynamic content, before trying to extract results.
  • Save sessions for sites you visit frequently to avoid re-authenticating each time.
  • Use evaluate to run custom JavaScript when the standard actions don't cover your needs.
  • For mass scraping (10+ profiles or pages), consider the apify tool instead — it handles proxies and rate limiting automatically.