Release binaries / Build macOS ARM64 (push) Has been cancelled
Release binaries / Build macOS x64 (push) Has been cancelled
Release binaries / Build Linux ARM64 (push) Has been cancelled
Release binaries / Build Linux musl ARM64 (push) Has been cancelled
Release binaries / Build Linux musl x64 (push) Has been cancelled
Release binaries / Build Linux x64 (push) Has been cancelled
Release binaries / Build Windows x64 (push) Has been cancelled
Release binaries / Attach binaries to GitHub Release (push) Has been cancelled
Standalone product rename across the whole repo (issue: project identity): - Binary/package/repo/skill/docs: agent-browser[-stealth] → chrome-use (single binary name `chrome-use`; old aliases agent-browser/abs dropped). - Version: 0.27.0-fork.51 → 1.0.0 (drop the upstream-fork counter). - Native-messaging host: com.agent_browser.connect → com.leeguoo.chrome_use (CLI + ab-connect extension in lockstep — this is a breaking handshake change, extension bumped 0.4.2 → 0.5.0, needs a Web Store republish). - Config dir: ~/.agent-browser → ~/.chrome-use. - README/zh: reframed from "stealth fork of agent-browser" to a standalone product with a small `originally based on vercel-labs/agent-browser` credit. - Kept AGENT_BROWSER_* env vars working (63 vars across the codebase; renaming them would break every existing script/skill for no user-facing gain). Build green, 802 unit tests pass, fmt + clippy clean. Upstream attribution to vercel-labs/agent-browser preserved.
70 lines
1.7 KiB
Bash
Executable File
70 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Template: Content Capture Workflow
|
|
# Purpose: Extract content from web pages (text, screenshots, PDF)
|
|
# Usage: ./capture-workflow.sh <url> [output-dir]
|
|
#
|
|
# Outputs:
|
|
# - page-full.png: Full page screenshot
|
|
# - page-structure.txt: Page element structure with refs
|
|
# - page-text.txt: All text content
|
|
# - page.pdf: PDF version
|
|
#
|
|
# Optional: Load auth state for protected pages
|
|
|
|
set -euo pipefail
|
|
|
|
TARGET_URL="${1:?Usage: $0 <url> [output-dir]}"
|
|
OUTPUT_DIR="${2:-.}"
|
|
|
|
echo "Capturing: $TARGET_URL"
|
|
mkdir -p "$OUTPUT_DIR"
|
|
|
|
# Optional: Load authentication state
|
|
# if [[ -f "./auth-state.json" ]]; then
|
|
# echo "Loading authentication state..."
|
|
# chrome-use state load "./auth-state.json"
|
|
# fi
|
|
|
|
# Navigate to target
|
|
chrome-use open "$TARGET_URL"
|
|
chrome-use wait --load networkidle
|
|
|
|
# Get metadata
|
|
TITLE=$(chrome-use get title)
|
|
URL=$(chrome-use get url)
|
|
echo "Title: $TITLE"
|
|
echo "URL: $URL"
|
|
|
|
# Capture full page screenshot
|
|
chrome-use screenshot --full "$OUTPUT_DIR/page-full.png"
|
|
echo "Saved: $OUTPUT_DIR/page-full.png"
|
|
|
|
# Get page structure with refs
|
|
chrome-use snapshot -i > "$OUTPUT_DIR/page-structure.txt"
|
|
echo "Saved: $OUTPUT_DIR/page-structure.txt"
|
|
|
|
# Extract all text content
|
|
chrome-use get text body > "$OUTPUT_DIR/page-text.txt"
|
|
echo "Saved: $OUTPUT_DIR/page-text.txt"
|
|
|
|
# Save as PDF
|
|
chrome-use pdf "$OUTPUT_DIR/page.pdf"
|
|
echo "Saved: $OUTPUT_DIR/page.pdf"
|
|
|
|
# Optional: Extract specific elements using refs from structure
|
|
# chrome-use get text @e5 > "$OUTPUT_DIR/main-content.txt"
|
|
|
|
# Optional: Handle infinite scroll pages
|
|
# for i in {1..5}; do
|
|
# chrome-use scroll down 1000
|
|
# chrome-use wait 1000
|
|
# done
|
|
# chrome-use screenshot --full "$OUTPUT_DIR/page-scrolled.png"
|
|
|
|
# Cleanup
|
|
chrome-use close
|
|
|
|
echo ""
|
|
echo "Capture complete:"
|
|
ls -la "$OUTPUT_DIR"
|