This project uses browser-use to run an LLM-driven browser agent that navigates to a page, finds a Pay button, and proceeds with payment.
Reference followed: Browser Use Quickstart
- Python 3.11+ (Windows)
- PowerShell 7 (pwsh)
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m ensurepip --upgrade
python -m pip install --upgrade pip setuptools wheel
python -m pip install browser-use python-dotenv playwright
python -m playwright install chromiumCopy-Item .env.example .env
# Edit .env and set keys and defaultsAt minimum set one supported LLM key (OPENAI_API_KEY, ANTHROPIC_API_KEY, or GOOGLE_API_KEY). Default model: gpt-4.1-mini.
Best Buy credentials (optional, recommended to set via .env instead of CLI):
BESTBUY_USERNAME=you@example.com # optional; preferred for login if set
BESTBUY_EMAIL=you@example.com
BESTBUY_PASSWORD=your-password
.\.venv\Scripts\python agent.py --url "https://example.com/checkout" --headless false --dry-run true--url: Target page; if omitted, usesTARGET_URLfrom.env.--headless:trueorfalse(defaultfalse).--dry-run: If true, the agent will NOT click; it will locate the button and report details.--confirm: Set toyesto allow clicking the pay button. If notyes, click actions are disabled.--labels: Comma-separated button labels to try (defaults from envPAY_BUTTON_LABELS).
Best Buy mode example (credentials pulled from .env if set):
.\.venv\Scripts\python agent.py --url "https://www.bestbuy.com" --query "iPhone 16 Pro" --dry-run true
# or to allow ordering if all checks pass (use with caution):
.\.venv\Scripts\python agent.py --url "https://www.bestbuy.com" --query "iPhone 16 Pro" --confirm yes --dry-run false- The agent restricts navigation to the target domain for safety.
- Ensure you comply with site terms and have consent to automate.
- For details on the Agent API and setup, see the Browser Use docs: Quickstart