跳到主要内容
此示例介绍了如何使用 Cheerio 从 Hacker News 网站加载数据。每个页面将创建一个文档。

设置

npm
npm install @langchain/community @langchain/core cheerio

用法

import { HNLoader } from "@langchain/community/document_loaders/web/hn";

const loader = new HNLoader("https://news.ycombinator.com/item?id=34817881");

const docs = await loader.load();

以编程方式连接这些文档到 Claude、VSCode 等,通过 MCP 获取实时答案。
© . This site is unofficial and not affiliated with LangChain, Inc.