Web Scraping API
收藏Web Scraping API 数据集概述
基本信息
- API名称: Web Scraping API
- 提供商: MGAdev
- 类别: Tools
- 基础URL:
https://web-scraping-api1.p.rapidapi.com - 端点:
POST /api/web-scraper - 版本: 1.0.0 (current)
- 订阅计划:
- BASIC: $0.00 / mo
- PRO: $50.00 / mo
- ULTRA: $85.00 / mo
- MEGA: $150.00 / mo
主要功能
- 提取动态网站的完整HTML内容
- 捕获高质量的全页截图
- 通过点击、等待和导航与元素交互
- 自定义User-Agent和视口(模拟移动/桌面设备)
- 屏蔽图片、广告、脚本和媒体以优化速度
- 所有请求均通过4G住宅代理路由
参数说明
| 参数 | 类型 | 描述 |
|---|---|---|
url |
string |
必需。目标URL |
steps |
array |
可选。操作如点击/等待 |
userAgent |
string |
可选。自定义User-Agent字符串 |
viewport |
object |
可选。模拟设备尺寸 |
screenshot |
number |
1 = 捕获截图,0 = 跳过 |
blockImages |
boolean |
可选。屏蔽图片 |
blockMedia |
boolean |
可选。屏蔽视频/音频 |
blockScripts |
boolean |
可选。屏蔽JavaScript |
示例用例
-
基本HTML和截图: json { "url": "https://example.com" }
-
最快模式 - 仅HTML: json { "url": "https://example.com", "screenshot": 0, "blockImages": true, "blockMedia": true, "blockScripts": false }
-
自定义移动视图和User Agent: json { "url": "https://www.whatismybrowser.com/detect/what-is-my-user-agent/", "userAgent": "Mozilla/5.0 (Linux; Android 11; Pixel 4a (5G)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4812.0 Mobile Safari/537.36", "viewport": { "width": 353, "height": 745, "deviceScaleFactor": 3, "isMobile": true, "hasTouch": true, "isLandscape": false, "fullPage": false, "hideAcceptCookies": true, "hideAllAds": true } }
-
高级步骤 - 完整交互: json { "url": "https://www.test.com/", "steps": [ { "type": "click", "timeout": 6000, "selectors": ["button#btn_id"] }, { "type": "click", "timeout": 6000, "selectors": ["h3.test"] }, { "type": "waitForNavigation", "timeout": 6000 }, { "type": "click", "timeout": 1000, "selectors": ["input.iAgreeCheck"] }, { "type": "waitForElement", "timeout": 1000, "selectors": ["div.successDiv"] } ], "screenshot": 1 }
响应结构
json { "status": "success", "statusCode": 200, "js": true, "url": "https://example.com", "finalUrl": "https://example.com", "screenshot": "unique-id.png", "html": "<html>...</html>" }
错误示例
json { "status": "error", "message": "Invalid URL or server error." }
适用场景
- 开发者构建数据驱动平台
- SEO工具和分析提供商
- 价格和产品跟踪系统
- 自动化和测试工具
联系与支持
- 联系邮箱: info@mga.dev




