跳到主要内容

Hacker News

这个例子介绍了如何使用 Cheerio 从 Hacker News 网站加载数据。每页将创建一个文档。

设置

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();

此页内容对您有帮助吗?


您也可以留下详细的反馈 在 GitHub 上.

© . This site is unofficial and not affiliated with LangChain, Inc.
这些文档随着 LangChain v1.0 在 2025 年 10 月的发布而弃用,并且不再维护。 请访问 v1.0 文档