Browser automation basics with praisonai-browser

Note: Requires praisonai-browser and Playwright/Chromium installed locally.

Navigate and read live rendered pages

Many modern apps render content with JavaScript so curl or requests only sees an empty <div>. praisonai-browser drives a real Chromium/CDP browser session so agents can inspect the live DOM and rendered text.

Example

# Start a browser session and navigate to a page
praisonai browser nav https://example.com

# Read clean visible page content and inspect the DOM tree
praisonai browser read-content
praisonai browser get-dom

Example explained

  • praisonai browser nav — Opens the target URL inside the managed browser session.
  • praisonai browser read-content — Extracts clean readable text after client-side JavaScript finishes rendering.
  • praisonai browser get-dom — Returns structured DOM nodes so an agent can target buttons and inputs accurately.

Run a goal-directed browser agent

Instead of writing brittle CSS selectors by hand, hand a concrete task to praisonai browser run and let the agent plan clicks, scrolls, and extractions.

Example

# Ask the browser agent to navigate and summarize visible pricing tiers
praisonai browser run "Open https://example.com, read the main heading and link target, and return JSON"

# Inspect active browser sessions and clean up
praisonai browser sessions

Example explained

  • praisonai browser run — Runs an autonomous observe-plan-act loop over the live browser tab.
  • praisonai browser sessions — Lists active browser sessions so you never leak background Chromium processes.

Common pitfall: using browser automation when an API exists

Browser sessions are slower and heavier than HTTP APIs. Use praisonai-browser for JS-rendered UIs, visual verification, or apps without APIs — use a normal Python tool or MCP server when a clean JSON API is available.

Reference: documentation