Skip to content
登录 注册

JSON自动解析器

设置 auto_parser=1,即可让 API 将页面解析为由标签、属性和文本组成的嵌套 JSON 结构。无论是否启用 JavaScript 渲染均可使用。

GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<TARGET_URL>&auto_parser=1
参数类型是否必填说明
api_keystring您的 Web Scraping API 密钥
urlstring要抓取的目标 URL
auto_parserinteger0(默认)或 1。设为 1 时,响应将返回解析后的 JSON。
Terminal window
curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https://example.com&auto_parser=1"
{
"0": {
"tagName": "div",
"children": {
"0": { "tagName": "h1", "text": "Example Domain" },
"1": { "tagName": "p", "text": "This domain is for use in illustrative examples in documents." },
"2": {
"tagName": "p",
"text": "More information...",
"children": {
"0": {
"tagName": "a",
"attributes": { "href": "https://www.iana.org/domains/example" },
"text": "More information..."
}
}
}
}
}
}