跳到主要內容
Open In ColabOpen on GitHub

PullMdLoader

使用 pull.md 服務將 URL 轉換為 Markdown 的載入器。

此套件實作一個用於網頁內容的文件載入器。與傳統的網頁爬蟲不同,PullMdLoader 可以處理使用動態 JavaScript 框架(如 React、Angular 或 Vue.js)建構的網頁,並將它們轉換為 Markdown,而無需在本機端渲染。

總覽

整合細節

類別套件本地可序列化JS 支援
PullMdLoaderlangchain-pull-md

設定

安裝

pip install langchain-pull-md

初始化

from langchain_pull_md.markdown_loader import PullMdLoader

# Instantiate the loader with a URL
loader = PullMdLoader(url="https://example.com")

載入

documents = loader.load()
documents[0].metadata
{'source': 'https://example.com',
'page_content': '# Example Domain\nThis domain is used for illustrative examples in documents. You may use this domain in literature without prior coordination or asking for permission.'}

延遲載入

未實作延遲載入。PullMdLoader 會在每次呼叫 load 方法時,即時將提供的 URL 轉換為 Markdown 格式。

API 參考:


此頁面是否對您有幫助?