Skip to main content
Glama

web-speed-agent

PyPI version Python License: GPL v3

인증된 웹 추출을 위한 로컬 브라우저 자동화 + Web Speed API 통합.

로그인이 필요한 사이트를 포함하여 모든 웹사이트에 AI 에이전트를 지정하고 깔끔하고 구조화된 데이터를 받아보세요. 자격 증명은 사용자의 컴퓨터에 유지됩니다. 추출된 HTML만 서버로 전송됩니다.

pip install web-speed-agent
playwright install chromium

Claude, Gemini 또는 기타 AI 클라이언트와 함께 사용하고 싶으신가요?

**MCP 서버 설치 가이드**를 확인하세요. AI 에이전트가 자연어를 통해 로그인하고 데이터를 추출하도록 하는 가장 쉬운 방법입니다.


작동 방식

Your machine                           Web Speed server
─────────────────────────────────      ──────────────────────────
Playwright browser (local)
  ↓ navigates, logs in, clicks
  ↓ gets page HTML
  ↓ (no passwords sent)
agent.extract(html)         ────────→  Advanced extraction engine
                            ←────────  Structured JSON

자격 증명은 절대 사용자의 컴퓨터를 떠나지 않습니다. 서버는 HTML만 볼 수 있습니다.


Related MCP server: Agent Identity MCP Server

빠른 시작

import asyncio
from web_speed_agent import Agent

async def main():
    agent = Agent(api_key="wsp_...")       # or set WEBSPEED_API_KEY env var

    # Public pages — no browser needed
    result = await agent.map("https://techcrunch.com/some-article/")
    print(result["article"]["sections"])

    # Authenticated pages — browser runs locally
    agent.store_credential("mysite", "me@example.com", "mypassword")

    async with agent.browser(session_name="mysite") as browser:
        page = await browser.new_page()
        await page.goto("https://mysite.com/login")

        username, password = agent.get_credential("mysite")
        await page.fill('[name="email"]', username)
        await page.fill('[name="password"]', password)
        await page.click('button[type="submit"]')
        await page.wait_for_load_state("networkidle")

        # Now on a logged-in page — extract it
        html = await page.content()
        result = await agent.extract(html, page_type="listing")
        print(result["listing"]["items"])

asyncio.run(main())

getwebspeed.io에서 API 키를 받으세요.


설치

요구 사항: Python 3.10+, Web Speed API 키

pip install web-speed-agent
playwright install chromium
export WEBSPEED_API_KEY="wsp_..."

핵심 개념

에이전트(Agent)

메인 클래스입니다. 자격 증명, 브라우저 세션 및 API 호출을 관리합니다.

from web_speed_agent import Agent

# API key from argument
agent = Agent(api_key="wsp_...")

# API key from environment variable (recommended)
# export WEBSPEED_API_KEY="wsp_..."
agent = Agent()

# Use as async context manager (auto-closes HTTP client)
async with Agent() as agent:
    ...

공개 페이지 추출

로그인이 필요 없는 페이지는 브라우저가 필요하지 않습니다:

# Fetch + extract in one call
result = await agent.map("https://example.com/article")

# With JavaScript rendering (for heavy SPAs)
result = await agent.map("https://example.com/spa", js=True)

인증된 페이지 추출

로컬 브라우저 세션을 사용하세요. 브라우저는 사용자의 컴퓨터에서 실행됩니다:

async with agent.browser(session_name="mysite") as browser:
    page = await browser.new_page()
    await page.goto("https://mysite.com/dashboard")
    html = await page.content()

result = await agent.extract(html)

session_name은 쿠키를 ~/.webspeed/sessions/<name>/에 유지하므로 이후 실행 시 로그인 단계를 건너뜁니다.


자격 증명 관리

자격 증명은 시스템 키체인(macOS 키체인, Windows 자격 증명 관리자, Linux secret-tool)에 저장됩니다. 절대 Web Speed 서버로 전송되지 않습니다.

# Store once
agent.store_credential("mysite", "me@example.com", "mypassword")

# Retrieve anywhere
username, password = agent.get_credential("mysite")

# Remove
agent.delete_credential("mysite")

추출 출력

서버는 페이지 유형을 인식하는 구조화된 데이터를 반환합니다:

# Article
result = await agent.extract(html, page_type="article")
# result["page_type"]    → "article"
# result["title"]        → "Article Title"
# result["author"]       → "Jane Smith"
# result["published_date"] → "2026-05-06"
# result["article"]["sections"] → [{"heading": "...", "paragraphs": [...]}]
# result["article"]["links"]    → [{"text": "...", "url": "..."}]

# Product
result = await agent.extract(html, page_type="product")
# result["product"]["name"]         → "Wireless Headphones"
# result["product"]["price"]        → "$99.99"
# result["product"]["availability"] → "In Stock"
# result["product"]["rating"]       → "4.5"
# result["product"]["specs"]        → {"Battery": "30h", ...}

# Listing (search results, category pages)
result = await agent.extract(html, page_type="listing")
# result["listing"]["items"] → [{"title": "...", "url": "...", "price": "..."}]

# Auto-detect (default)
result = await agent.extract(html)
# result["page_type"] → "article" | "product" | "listing" | "other"

모든 결과에는 engine: "advanced"가 포함되어 있으며, 원시 HTML보다 토큰 효율성이 60~85% 더 높습니다.


예시

가격 모니터

import asyncio
from web_speed_agent import Agent

async def check_price(url: str, site_name: str) -> str:
    async with Agent() as agent:
        agent.store_credential(site_name, "me@example.com", "password", overwrite=True)

        async with agent.browser(session_name=site_name) as browser:
            page = await browser.new_page()

            # Login
            await page.goto(f"https://{site_name}.com/login")
            user, pwd = agent.get_credential(site_name)
            await page.fill('[name="email"]', user)
            await page.fill('[name="password"]', pwd)
            await page.click('button[type="submit"]')
            await page.wait_for_load_state("networkidle")

            # Check product
            await page.goto(url)
            await page.wait_for_load_state("networkidle")
            html = await page.content()

        result = await agent.extract(html, page_type="product")
        return result.get("product", {}).get("price", "unknown")

price = asyncio.run(check_price("https://example.com/product/123", "example"))
print(f"Current price: {price}")

개인 대시보드 읽기

import asyncio
from web_speed_agent import Agent

async def get_dashboard_data():
    async with Agent() as agent:
        async with agent.browser(session_name="analytics") as browser:
            page = await browser.new_page()

            # Login (first run only — session persists after)
            creds = agent.get_credential("analytics")
            if not creds:
                agent.store_credential("analytics", "me@company.com", "password")
                creds = agent.get_credential("analytics")

            await page.goto("https://analytics.company.com/login")
            await page.fill('[name="email"]', creds[0])
            await page.fill('[name="password"]', creds[1])
            await page.click('button[type="submit"]')
            await page.wait_for_load_state("networkidle")

            # Navigate to dashboard
            await page.goto("https://analytics.company.com/dashboard")
            await page.wait_for_selector(".metrics-table", timeout=10000)
            html = await page.content()

        result = await agent.extract(html)
        return result

asyncio.run(get_dashboard_data())

로그인 상태에서 다중 페이지 스크래핑

import asyncio
from web_speed_agent import Agent

async def scrape_inbox():
    async with Agent() as agent:
        async with agent.browser(session_name="webmail") as browser:
            page = await browser.new_page()

            # Login
            await page.goto("https://mail.example.com/login")
            user, pwd = agent.get_credential("webmail")
            await page.fill('[name="username"]', user)
            await page.fill('[name="password"]', pwd)
            await page.click('[type="submit"]')
            await page.wait_for_load_state("networkidle")

            # Scrape multiple pages
            emails = []
            for page_num in range(1, 4):
                await page.goto(f"https://mail.example.com/inbox?page={page_num}")
                await page.wait_for_load_state("networkidle")
                html = await page.content()
                result = await agent.extract(html, page_type="listing")
                emails.extend(result.get("listing", {}).get("items", []))

        return emails

asyncio.run(scrape_inbox())

AI 에이전트 통합 (MCP)

포함된 MCP 서버를 사용하면 Claude Desktop, Gemini CLI 및 모든 MCP 호환 에이전트가 SDK를 직접 사용할 수 있습니다. 에이전트는 자연어를 통해 로그인, 탐색, 클릭 및 추출을 수행할 수 있습니다.

MCP 서버 시작:

WEBSPEED_API_KEY="wsp_..." python3 agent_mcp_server.py

Claude Desktop에 추가 (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "web-speed-agent": {
      "command": "python3",
      "args": ["/path/to/agent_mcp_server.py"],
      "env": {
        "WEBSPEED_API_KEY": "wsp_..."
      }
    }
  }
}

Gemini CLI에 추가 (~/.gemini/settings.json):

{
  "mcpServers": {
    "web-speed-agent": {
      "command": "python3.11",
      "args": ["/path/to/agent_mcp_server.py"],
      "env": {
        "WEBSPEED_API_KEY": "wsp_...",
        "PYTHONPATH": "/path/to/web-speed-agent"
      }
    }
  }
}

그런 다음 에이전트에게 다음과 같이 말하세요:

"united에 대한 자격 증명을 저장해줘 - 사용자 이름 me@example.com, 비밀번호 mypassword"

"united.com에 로그인해서 다음 주 금요일 SFO에서 JFK로 가는 가장 저렴한 항공편을 찾아줘"

사용 가능한 MCP 도구:

도구

설명

store_credential

시스템 키체인에 로그인 정보 저장

login

브라우저 열기 + 로그인

navigate

활성 세션에서 URL로 이동

extract_page

현재 페이지에서 구조화된 데이터 가져오기

click

버튼이나 링크 클릭

fill_field

양식 필드에 입력

submit_form

양식 제출

close_browser

브라우저 세션 종료

account_info

API 크레딧 잔액 확인


API 참조

Agent

Agent(
    api_key: str | None = None,
    server_url: str | None = None,
    config_dir: str = "~/.webspeed",
    headless: bool = True,
)

매개변수

설명

api_key

Web Speed API 키. WEBSPEED_API_KEY 환경 변수로 대체 가능.

server_url

API 서버 URL 재정의. 기본값: https://api.getwebspeed.io.

config_dir

설정, 세션 및 로그용 디렉토리. 기본값: ~/.webspeed.

headless

브라우저를 헤드리스 모드로 실행. 기본값: True.


agent.browser()

agent.browser(
    session_name: str | None = None,
    headless: bool | None = None,
    proxy: str | None = None,
) -> ManagedBrowser

비동기 컨텍스트 관리자를 반환합니다. 블록 내부에서 .new_page()를 호출하여 Playwright Page를 가져옵니다.

매개변수

설명

session_name

쿠키를 ~/.webspeed/sessions/<name>/에 유지. None = 유지 안 함.

headless

이 세션에 대해 인스턴스 headless 재정의.

proxy

프록시 URL (예: "socks5://localhost:1080").

세션 이름은 영숫자 + 하이픈/밑줄이어야 하며, 최대 64자까지 가능합니다.


agent.extract()

await agent.extract(
    html: str,
    page_type: str = "auto",
) -> dict

HTML을 Web Speed API로 보냅니다. 1 크레딧이 소모됩니다.

매개변수

설명

html

원시 HTML 문자열 (예: page.content()에서 가져옴).

page_type

"article", "product", "listing" 또는 "auto".


agent.map()

await agent.map(
    url: str,
    js: bool = False,
) -> dict

서버를 통해 공개 URL을 가져오고 추출합니다. 로컬 브라우저가 필요하지 않습니다. 1 크레딧이 소모됩니다.

매개변수

설명

url

페이지 URL. http:// 또는 https://여야 함.

js

추출 전 JavaScript 렌더링.


agent.account()

await agent.account() -> dict

반환값: credits, tier, status, lifetime (총계/성공/실패).


agent.store_credential()

agent.store_credential(
    site: str,
    username: str,
    password: str,
    overwrite: bool = False,
) -> None

시스템 키체인에 저장합니다. 자격 증명이 존재하고 overwrite=False인 경우 CredentialError를 발생시킵니다.


agent.get_credential()

agent.get_credential(site: str) -> tuple[str, str] | None

(username, password)를 반환하거나 찾을 수 없는 경우 None을 반환합니다.


agent.delete_credential()

agent.delete_credential(site: str) -> None

키체인에서 자격 증명을 제거합니다.


예외

from web_speed_agent import (
    WebSpeedError,          # Base exception
    AuthenticationError,    # Invalid/missing API key
    InsufficientCreditsError, # No credits remaining
    APIError,               # API returned 4xx/5xx
    RateLimitError,         # 429 Too Many Requests
    CredentialError,        # Keychain error
    BrowserError,           # Playwright error
    NetworkError,           # Timeout or DNS failure
    PlaywrightNotInstalledError, # Run: playwright install chromium
)
from web_speed_agent import Agent, InsufficientCreditsError, NetworkError

try:
    result = await agent.extract(html)
except InsufficientCreditsError:
    print("Out of credits — top up at getwebspeed.io")
except NetworkError as e:
    print(f"Connection failed: {e}")

구성

환경 변수

변수

설명

WEBSPEED_API_KEY

API 키 (설정 파일보다 권장됨)

WEBSPEED_SERVER_URL

서버 URL 재정의 (https://여야 함)

설정 파일

~/.webspeed/config.yaml — 첫 실행 시 자동으로 생성됩니다. 권한은 0o600(소유자 전용)으로 설정됩니다.

api:
  server_url: https://api.getwebspeed.io
  timeout: 30

browser:
  headless: true

세션 파일

유지된 브라우저 세션은 ~/.webspeed/sessions/<name>/storage.json에 저장됩니다.

  • 권한: 0o600 (소유자 전용)

  • 포함 내용: 쿠키, localStorage, sessionStorage

  • 삭제해도 안전함: 에이전트가 다음 실행 시 다시 인증함


보안

사용자의 컴퓨터를 떠나는 데이터

agent.extract(html)을 호출하면 페이지 HTML이 처리를 위해 Web Speed API로 전송됩니다. 그 외 모든 것은 로컬에 유지됩니다.

데이터

전송 위치

로그인 자격 증명

절대 사용자의 컴퓨터를 떠나지 않음 (시스템 키체인 전용)

브라우저 쿠키 / 세션

절대 사용자의 컴퓨터를 떠나지 않음 (로컬 Playwright)

페이지 HTML

추출을 위해 HTTPS를 통해 Web Speed API로 전송

추출된 JSON

사용자에게 반환

HTML 스크러빙 (기본값)

HTML이 전송되기 전에 SDK는 로컬에서 자동으로 스크러빙을 수행합니다:

  • 인라인 <script><style> 블록 제거

  • 인증 관련 이름(csrf, token, nonce, session 등)이 포함된 숨겨진 양식 필드의 값을 공백으로 처리

  • 민감한 <meta> 콘텐츠 속성 삭제

  • HTML 주석 제거

텍스트, 링크, 표, 제목, 제품 데이터와 같은 가시적인 콘텐츠는 변경되지 않습니다.

# Default: scrubbing is on
result = await agent.extract(html)

# Turn off only if the page has no sensitive data
result = await agent.extract(html, scrub=False)

# Or scrub manually and inspect before sending
from web_speed_agent import scrub
clean_html = scrub(raw_html)
print(clean_html)  # inspect what will be sent
result = await agent.extract(clean_html, scrub=False)

서버 측 데이터 처리

  • HTML은 메모리 내에서만 처리 — 디스크에 기록되지 않으며, 로그에 남지 않고, 캐시되지 않음

  • 인증이 필요한 페이지는 절대 캐시되지 않음 — 로그인이 필요한 페이지는 공유 레지스트리에서 명시적으로 제외됨

  • 사용 로그에는 다음만 저장: API 키 해시, URL 해시(또는 "sdk-extract"), 타임스탬프, 감지된 페이지 유형 — 콘텐츠는 저장되지 않음

  • 오류 응답에 원시 HTML 포함 안 함 — 오류가 반환되기 전에 예외가 삭제됨

기타 보호 조치

  • 자격 증명은 시스템 키체인에 저장되며, 파일에 저장되거나 서버로 전송되지 않음

  • 세션 파일0o600 권한(소유자 전용 읽기/쓰기)으로 작성됨

  • 설정 디렉토리0o700 권한으로 생성됨

  • TLS 항상 검증 — 모든 HTTP 호출에서 verify=True, 비활성화 불가

  • HTTPS 강제server_urlhttps://로 시작해야 하며, 일반 HTTP는 거부됨

  • 경로 탐색 방지 — 세션 이름은 [a-zA-Z0-9_-] 허용 목록에 대해 검증됨

  • 자격 증명 로깅 금지 — 비밀번호는 로그나 오류 메시지에 절대 나타나지 않음


라이선스

GNU General Public License v3.0 — LICENSE를 참조하세요.

Web Speed API 사용은 Web Speed 서비스 약관을 따릅니다.

A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    Provides an MCP-native agent browser that enables autonomous agents to perceive and interact with web pages through stealth browsing, identity borrowing, and WAAP detection.
    9
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables MCP-capable runtimes to read agent message rooms, sign and post public messages, and create or verify Ed25519 contribution proofs for Technocore.
    MIT

View all related MCP servers

Related MCP Connectors

  • Agent-first web hosting: deploy sites, apps, databases and domains over MCP.

  • Hosted AgentLux MCP server for marketplace, identity, creator, services, and social flows.

  • MCP Server for agents to onboard, pay, and provision services autonomously with InFlow

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Dominic-Pi-Sunyer/web-speed-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server