登录

API 用法

Crawling API 请求中添加 &scraper=quora-question。在 url 参数中对目标 URL 进行 URL 编码。

curl 'https://api.crawlbase.com/?token=YOUR_TOKEN' \
  --data-urlencode 'url=https://www.quora.com/Which-is-the-best-tool-for-scraping-customer-reviews' \
  --data-urlencode 'scraper=quora-question' -G
from crawlbase import CrawlingAPI

api = CrawlingAPI({'token': 'YOUR_TOKEN'})
res = api.get(
    'https://www.quora.com/Which-is-the-best-tool-for-scraping-customer-reviews',
    {'scraper': 'quora-question'}
)

import json
data = json.loads(res['body'])
const { CrawlingAPI } = require('crawlbase');
const api = new CrawlingAPI({ token: 'YOUR_TOKEN' });

const res = await api.get(
  'https://www.quora.com/Which-is-the-best-tool-for-scraping-customer-reviews',
  { scraper: 'quora-question' }
);
const data = JSON.parse(res.body);
require 'crawlbase'
api = Crawlbase::API.new(token: 'YOUR_TOKEN')

res = api.get('https://www.quora.com/Which-is-the-best-tool-for-scraping-customer-reviews', scraper: 'quora-question')
data = JSON.parse(res.body)

示例输入 URL

传入 url 参数的 URL(为便于阅读已 URL 解码):

https://www.quora.com/Which-is-the-best-tool-for-scraping-customer-reviews

响应结构

JSON 响应体。当源页面省略对应值时,字段类型可能为 null

question_title
string
问题标题。
question_details
string | null
问题补充��情。
tags
array
话题标签。
answer_count
integer
答案总数。
follower_count
integer
关注者数量。
view_count
integer | null
浏览总数。
answers
array
答案对象。
answers[].author_name
string
答案作者。
answers[].author_credentials
string | null
作者资历信息。
answers[].body
string
答案正文。
answers[].upvotes
integer
点赞数。
related_questions
array
相关问题的 URL 和标题。

示例响应

{
  "question_title": "Which is the best tool for scraping customer reviews?",
  "answer_count": 14,
  "follower_count": 42,
  "answers": [
    {
      "author_name": "John Smith",
      "author_credentials": "Data Engineer",
      "upvotes": 218
    }
  ]
}