PullMd Loader
PullMd is a service that converts web pages into Markdown format. The
langchain-pull-mdpackage utilizes this service to convert URLs, especially those rendered with JavaScript frameworks like React, Angular, or Vue.js, into Markdown without the need for local rendering.
安装与设置
要开始使用 langchain-pull-md,你需要通过 pip 安装该包:
pip install langchain-pull-md
查看使用示例以获取详细的集成和使用说明。
文档加载器
PullMdLoader 类在 langchain-pull-md 中提供了一种将URL转换为Markdown的简便方法。它在从现代Web应用程序加载内容以用于LangChain的处理能力方面特别有用。
from langchain_pull_md import PullMdLoader
# Initialize the loader with a URL of a JavaScript-rendered webpage
loader = PullMdLoader(url='https://example.com')
# Load the content as a Document
documents = loader.load()
# Access the Markdown content
for document in documents:
print(document.page_content)
此加载器支持任何 URL,尤其擅长处理使用动态 JavaScript 构建的网站,使其成为数据处理工作流中标记提取的多功能工具。
API 参考
有关所有可用功能及其参数的完整指南,请访问API参考。