跳到主要内容

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 上.