MarkGrab

io.github.ArkNill由 GitHub 帳號 ArkNill 發布v0.1.2更新於 Oct 25, 2026

Universal web content extraction — any URL to LLM-ready markdown. HTML, YouTube, PDF, DOCX.

概覽

AI 產生的概覽

MarkGrab 是一個本機 Python MCP 伺服器,可抓取任意 URL,並把 HTML 頁面、YouTube 影片、PDF 與 DOCX 檔案轉成適合大型語言模型使用的乾淨 Markdown。

可以做什麼
抓取 URL 並將內容轉為乾淨的 Markdown、純文字或結構化 JSON,同時回傳標題、字數、偵測到的語言與內容類型。處理 HTML 頁面時依內容密度過濾,移除導覽列、側欄與廣告。擷取附時間戳的 YouTube 字幕。從 PDF 依頁面結構擷取文字,從 DOCX 依段落與標題擷取文字。對需要 JavaScript 的頁面自動改用 Playwright 瀏覽器渲染,可選擇啟用反機器人腳本,並支援自訂逾時、代理與輸出長度限制。
適用情境
適合需要讓助理以整齊 Markdown 而非原始 HTML 閱讀網頁文章、論文、文件或影片字幕的情境,例如資料研究、摘要產生或把內容送入處理流程。
執行需求
以 pip 安裝的 Python 套件形式在本機執行;選用附加元件可啟用 Playwright 瀏覽器渲染、YouTube 字幕、PDF 與 DOCX 解析。需要能連線至目標 URL 的網路。未宣告任何帳號、API 金鑰或環境變數。
安裝前請注意
此伺服器不檢查也不遵守 robots.txt,且沒有內建限流,須自行遵守網站條款並控制請求頻率。YouTube 字幕擷取依賴非官方字幕介面,可能不符合 YouTube 服務條款。隱匿模式會修改瀏覽器指紋以規避機器人偵測。抓取的 URL 會傳送至目標網站,YouTube 內容還會經過第三方套件。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 MarkGrab,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

MarkGrab

[PyPI] [Python] [License] [Tests]

한국어 문서 · llms.txt

Universal web content extraction — any URL to LLM-ready markdown.

python
from markgrab import extract
result = await extract("https://example.com/article")print(result.markdown)    # clean markdownprint(result.title)       # "Article Title"print(result.word_count)  # 1234print(result.language)    # "en"

Features

  • HTML — BeautifulSoup + content density filtering (removes nav, sidebar, ads)
  • YouTube — transcript extraction with timestamps
  • PDF — text extraction with page structure
  • DOCX — paragraph and heading extraction
  • Auto-fallback — tries lightweight httpx first, falls back to Playwright for JS-heavy pages
  • Async-first — built on httpx and Playwright async APIs

Install

bash
pip install markgrab

Optional extras for specific content types:

bash
pip install "markgrab[browser]"    # Playwright for JS-rendered pagespip install "markgrab[youtube]"    # YouTube transcript extractionpip install "markgrab[pdf]"       # PDF text extractionpip install "markgrab[docx]"      # DOCX text extractionpip install "markgrab[all]"       # everything

Usage

Python API

python
import asynciofrom markgrab import extract
async def main():    # HTML (auto-detects content type)    result = await extract("https://example.com/article")
    # YouTube transcript    result = await extract("https://youtube.com/watch?v=dQw4w9WgXcQ")
    # PDF    result = await extract("https://arxiv.org/pdf/1706.03762")
    # Options    result = await extract(        "https://example.com",        max_chars=30_000,       # limit output length (default: 50K)        use_browser=True,       # force Playwright rendering        stealth=True,           # anti-bot stealth scripts (opt-in)        timeout=60.0,           # request timeout in seconds        proxy="http://proxy:8080",    )
asyncio.run(main())

CLI

bash
markgrab https://example.com                     # markdown outputmarkgrab https://example.com -f text             # plain textmarkgrab https://example.com -f json             # structured JSONmarkgrab https://example.com --browser           # force browser renderingmarkgrab https://example.com --max-chars 10000   # limit output

ExtractResult

python
result.title        # page titleresult.text         # plain textresult.markdown     # LLM-ready markdownresult.word_count   # word countresult.language     # detected language ("en", "ko", ...)result.content_type # "article", "video", "pdf", "docx"result.source_url   # final URL (after redirects)result.metadata     # extra metadata (video_id, page_count, etc.)

How it works

mermaid
flowchart TD    A["🔗 URL Input"] --> B{"Content\nType?"}    B -->|"HTML"| C["HTTP fetch\n(httpx)"]    C --> D{"JS\nrequired?"}    D -->|"no"| E["HTML Parser\n→ clean markdown"]    D -->|"yes"| F["Playwright\nfallback"]    F --> E    B -->|"YouTube"| G["Transcript API\n→ timestamped markdown"]    B -->|"PDF"| H["PDF Parser\n→ structured markdown"]    B -->|"DOCX"| I["DOCX Parser\n→ markdown"]    E --> J["✅ LLM-ready\nMarkdown"]    G --> J    H --> J    I --> J

For HTML pages, if the initial httpx fetch yields fewer than 50 words, MarkGrab automatically retries with Playwright to handle JavaScript-rendered content.

Disclaimer

This software is provided for legitimate purposes only. By using MarkGrab, you agree to the following:

  • robots.txt: MarkGrab does not check or enforce robots.txt. Users are solely responsible for checking and respecting robots.txt directives and the terms of service of any website they access.

  • Rate limiting: MarkGrab does not include built-in rate limiting or request throttling. Users must implement their own rate limiting to avoid overloading target servers. Abusive request patterns may violate applicable laws and website terms of service.

  • YouTube transcripts: YouTube transcript extraction relies on the third-party youtube-transcript-api library, which uses YouTube's internal (unofficial) caption API. This may not comply with YouTube's Terms of Service. Use at your own discretion and risk.

  • Stealth mode: The optional stealth=True feature modifies browser fingerprinting signals to reduce bot detection. This feature is intended for legitimate use cases such as testing, research, and accessing content that is publicly available to regular browser users. Users are responsible for ensuring their use complies with applicable laws and the terms of service of target websites.

  • Legal compliance: Users are responsible for ensuring that their use of MarkGrab complies with all applicable laws, including but not limited to the Computer Fraud and Abuse Act (CFAA), the Digital Millennium Copyright Act (DMCA), GDPR, and equivalent legislation in their jurisdiction.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. See the LICENSE file for the full MIT license text.

Acknowledgments

MarkGrab builds on excellent open-source work and well-established techniques:

  • puppeteer-extra-plugin-stealth — stealth evasion patterns (webdriver removal, plugin mocking, WebGL spoofing) that inspired the opt-in anti_bot/stealth.py module
  • Mozilla Readability — content area detection priority (article > main > body) and link density filtering concepts used in the density filter
  • Boilerpipe (Kohlschutter et al., 2010) — the academic origin of link density ratio algorithms for boilerplate removal
  • Jina Reader — validated the market need for URL-to-markdown extraction; MarkGrab aims to be a lightweight, self-hosted alternative

Built with httpx, BeautifulSoup, markdownify, Playwright, youtube-transcript-api, pdfplumber, and python-docx.

Used in

  • newswatch — RSS news monitoring pipeline (feedkit → markgrab → embgrep → diffgrab)
  • watchdeck — Web page monitoring with visual diffs and safety guards

License

MIT


Part of the QuartzUnit ecosystem — composable Python libraries for data collection, extraction, search, and AI agent safety.

來源:README.md,提交 9a7a9be

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.2最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分