visit-webpage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVisit Webpage
访问网页
Fetch and extract readable content from web pages as markdown, or download images. Handles JavaScript-rendered content via Jina Reader service.
从网页中获取并提取可读内容为markdown格式,或下载图片。通过Jina Reader服务处理JavaScript渲染的内容。
Setup
设置
Optionally get a Jina API key for higher rate limits:
- Create an account at https://jina.ai/
- Get your API key from the dashboard
- Add to your shell profile (or
~/.profilefor zsh):~/.zprofilebashexport JINA_API_KEY="your-api-key-here"
Without an API key, the service works with rate limits.
可选获取Jina API密钥以获得更高的请求速率限制:
- 在https://jina.ai/创建账户
- 从控制台获取你的API密钥
- 添加到你的shell配置文件中(zsh用户为~/.profile或~/.zprofile):
bash
export JINA_API_KEY="your-api-key-here"
没有API密钥的话,服务仍可使用,但会受到速率限制。
Usage
使用方法
bash
{baseDir}/visit.py <url>bash
{baseDir}/visit.py <url>Examples
示例
bash
undefinedbash
undefinedRead an article (returns markdown)
读取文章(返回markdown格式)
{baseDir}/visit.py https://example.com/article
{baseDir}/visit.py https://example.com/article
Fetch documentation
获取文档
{baseDir}/visit.py https://docs.python.org/3/library/asyncio.html
{baseDir}/visit.py https://docs.python.org/3/library/asyncio.html
Download an image (auto-detected by content-type)
下载图片(通过内容类型自动检测)
{baseDir}/visit.py https://example.com/image.png
{baseDir}/visit.py https://example.com/image.png
Then use read tool to view: read /tmp/visit-image-xxx.png
之后使用read工具查看:read /tmp/visit-image-xxx.png
undefinedundefinedOutput
输出
For HTML pages: Returns markdown content to stdout.
For images: Downloads the image to a temp file and prints the path. Use the tool to view it. Supports PNG, JPEG, GIF, and WebP formats.
read对于HTML页面:将markdown内容输出到标准输出。
对于图片:将图片下载到临时文件并打印路径。使用工具查看。支持PNG、JPEG、GIF和WebP格式。
readFeatures
功能特性
- Extracts main content from HTML pages
- Converts HTML to clean markdown
- Handles JavaScript-rendered pages via Jina Reader
- Auto-detects and downloads images to temp files
- Retries on rate limiting (HTTP 451)
- 5MB max image size limit
- 从HTML页面提取主要内容
- 将HTML转换为整洁的markdown格式
- 通过Jina Reader处理JavaScript渲染的页面
- 自动检测并将图片下载到临时文件
- 遇到速率限制(HTTP 451)时自动重试
- 图片最大大小限制为5MB
When to Use
使用场景
- Reading articles, blog posts, or documentation
- Extracting content from search results
- Downloading images from URLs (then use to view)
read - Following links found during web search
- 阅读文章、博客帖子或文档
- 从搜索结果中提取内容
- 从URL下载图片(然后使用查看)
read - 访问网页搜索中找到的链接