跳到主要内容
Hacker News(有时缩写为 HN)是一个关注计算机科学和创业精神的社交新闻网站。它由投资基金和创业孵化器 Y Combinator 运营。通常,可以提交的内容被定义为“任何能够满足个人求知欲的东西”。
本笔记本介绍了如何从 Hacker News 中提取页面数据和评论。
from langchain_community.document_loaders import HNLoader
loader = HNLoader("https://news.ycombinator.com/item?id=34817881")
data = loader.load()
data[0].page_content[:300]
"delta_p_delta_x 73 days ago  \n             | next [–] \n\nAstrophysical and cosmological simulations are often insightful. They're also very cross-disciplinary; besides the obvious astrophysics, there's networking and sysadmin, parallel computing and algorithm theory (so that the simulation programs a"
data[0].metadata
{'source': 'https://news.ycombinator.com/item?id=34817881',
 'title': 'What Lights the Universe’s Standard Candles?'}

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