Skip to main content

Documentation Index

Fetch the complete documentation index at: https://langchain-zh.cn/llms.txt

Use this file to discover all available pages before exploring further.

本示例介绍如何使用 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();