Hacker News
本示例介绍如何使用 Cheerio 从黑客新闻网站加载数据。将为每个页面创建一个文档。
¥This example goes over how to load data from the hacker news website, using Cheerio. One document will be created for each page.
设置
¥Setup
- npm
- Yarn
- pnpm
npm install @langchain/community @langchain/core cheerio
yarn add @langchain/community @langchain/core cheerio
pnpm add @langchain/community @langchain/core cheerio
用法
¥Usage
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();