agentcore-browser-web-scraping

agentcore-browser-web-scraping is a skill for Claude Code, Codex from aws-samples/sample-agent-skills-for-builders. It costs 142 tokens per session (1,904 once invoked), scanned A, original, Apache-2.0.

A guide for building production web scrapers with Amazon Bedrock AgentCore Browser and Playwright, tools for controlling a web browser from code.

In plain words
What is it for?
Use it to scrape dynamic pages, social feeds, forums, and review sites, including logged-in sites, with navigation, scrolling, screenshots, text extraction, and selector-based extraction.
Why use it?
It provides a fixed set of browser actions for extracting data from JavaScript-loaded pages and pages that require login, while keeping login state in browser profiles.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one.

Good fit Use it to scrape dynamic pages, social feeds, forums, and review sites, including logged-in sites, with navigation, scrolling, screenshots, text extraction, and selector-based extraction.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping
About the project

Sample Agent Skills for Builders is a collection of reusable skills that extend AI coding agents with AWS, CDK, security, testing, and engineering workflows. Developers can install the skills for practical AWS development tasks or use the repository as a model for creating their own agent skills. The catalogue entries are skills and instructions from this collection.

aws-samples/sample-agent-skills-for-builders · 47 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add aws-samples/sample-agent-skills-for-builders --skill agentcore-browser-web-scraping
Clone the repo
git clone --depth 1 https://github.com/aws-samples/sample-agent-skills-for-builders

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for agentcore-browser-web-scraping

README.md
[![agentmods](https://agentmods.dev/badge/skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping/github.svg)](https://agentmods.dev/skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping)
Your own site
<a href="https://agentmods.dev/skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping"><img src="https://agentmods.dev/badge/skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for agentcore-browser-web-scraping

Your own site · 80×15
<a href="https://agentmods.dev/skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping"><img src="https://agentmods.dev/badge/skills/aws-samples/sample-agent-skills-for-builders/agentcore-browser-web-scraping.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,904 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00142 $0.01904
Opus 5 $0.00071 $0.00952
Sonnet 5 $0.00028 $0.00381
Haiku 4.5 $0.00014 $0.00190

Measured 9d ago against content hash ae67fc7680b7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

agentcore-browser-web-scraping scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/agentcore-browser-web-scraping/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AgentCore Browser Web Scraping

Amazon Bedrock AgentCore Browser gives you a managed cloud Chromium — no crawler fleet, no resident containers, per-session billing, natural isolation. This skill captures a production scraping architecture built on it: an LLM agent decides what to do on the page, but only through fixed code primitives it can parameterize, never arbitrary scripts. Login state lives in Browser Profiles that users populate once through a live-view session, so credentials never transit the conversation.

Collector (Python, worker thread)
  ├─ browser_session(region, profile_configuration=..., proxy_configuration=...)
  │      └─ StartBrowserSession → generate_ws_headers() (SigV4)
  │             └─ playwright chromium.connect_over_cdp(ws_url, headers)
  └─ Strands Agent (LLM) with 6 fixed tools:
        navigate / scroll_to_bottom / click_load_more /
        get_page_text / screenshot / extract_by_selector

When to Apply

Reference this skill when:

  • Scraping dynamic, JS-rendered, or lazy-loading pages (social feeds, forums, review sites) with AgentCore Browser + Playwright.
  • Scraping sites that require login (X/Twitter, Reddit, Instagram) and you need reusable login state that never leaves AWS.
  • Scrapes return 0 items on pages that clearly have content — usually a scroll-container or login-wall misdiagnosis, both covered here.
  • Google SSO inside the cloud browser silently fails (third-party cookies).
  • The target site blocks AWS egress IPs and you need an external proxy.

Not for: general AgentCore Browser service overview or session APIs — see the aws-agentic-ai skill's Browser service docs for that.

How It Works

1. Session, connection, and the LLM-driven extraction loop

Connect Playwright to the managed browser over a SigV4-signed CDP WebSocket, then let an LLM agent drive a bounded tool loop. Key decisions:

  • LLM decides, code executes. A hand-written script per site doesn't scale across arbitrary DOMs; raw LLM-generated JS is an injection surface. The middle path: six fixed tools, the model only supplies parameters.
  • extract_by_selector: a constant JS extraction template evaluated with the model's CSS selectors passed as data arguments — zero string concatenation, zero eval. Preserves item boundaries and attributes that a flat innerText dump loses.
  • screenshot (downscaled JPEG returned as an image tool-result) lets the model see the page and distinguish "genuinely empty" from login wall / CAPTCHA / cookie banner before declaring failure.
  • Adaptive step budget: scale the agent's max tool-steps (and the session timeout) with the requested record count — lazy feeds yield 10–20 items per scroll, so a fixed small budget silently under-collects.
  • Scrolling that actually works: document.body.scrollHeight is 0 on flex layouts (YouTube) — scroll document.scrollingElement instead, and also iterate inner overflow panels; comments often live in an overlay that window scrolling never touches.
  • SSRF guard: HTTPS-only, no IP literals, private ranges and IMDS blocked for the hostname and every resolved IP — re-validated inside the navigate tool on every call, so the model can't pivot mid-session.

Read the full file on GitHub · 150 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 150 lines · 142 tokens per session scan A ae67fc7680b7

Subscribe to this mod's changes

agentcore-browser-web-scraping is a skill published in the GitHub repository aws-samples/sample-agent-skills-for-builders (47 stars, last pushed 12d ago), licensed Apache-2.0. It adds 142 tokens to every session and 1,904 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

opencli-sitemap-author

Use when creating or maintaining OpenCLI site sitemaps: agent-facing navigation, page-state, action, workflow, API-reference, pitfall, and fallback knowledge for a website. Use after browser exploration discovers durable site context, when a sitemap is stale, or when promoting local site knowledge into the repo.

jackwener/OpenCLI · 67 tokens

debug-optimize-lcp

Guides debugging and optimizing Largest Contentful Paint (LCP) using Chrome DevTools MCP tools. Use this skill whenever the user asks about LCP performance, slow page loads, Core Web Vitals optimization, or wants to understand why their page's main content takes too long to appear. Also use when the user mentions…

ChromeDevTools/chrome-devtools-mcp · 99 tokens

interactive-login

How to complete browser/interactive logins (aws / gh / glab / gcloud). The platform backgrounds the login poller so it survives the human's browser round-trip — and when that does NOT work.

yc-software/qm · 46 tokens

pinchtab-mcp

Use this skill when a task requires browser automation through PinchTab's MCP server connected to a remote browser instance. Covers navigation, element interaction, data extraction, form filling, multi-step flows, and session management via MCP tools.

pinchtab/pinchtab · 52 tokens

azure-messaging-webpubsub-java

Build real-time web applications with Azure Web PubSub SDK for Java. Use when implementing WebSocket-based messaging, live updates, chat applications, or server-to-client push notifications.

microsoft/skills · 43 tokens

google-safe-browsing

Prevent and fix Google Safe Browsing "Dangerous site" flags. Use when launching a public web app, buying/picking a domain, building a login or signup page, or when any site shows a red "Dangerous site" / "Deceptive site" warning in Chrome, Brave, Safari, Firefox, or Edge. Triggers on "dangerous site", "deceptive…

davidondrej/skills · 105 tokens