For the complete documentation index, see llms.txt. This page is also available as Markdown.

Airbnb

了解如何使用 Airbnb 抓取器。

使用网页爬虫API,您可以抓取各种类型的 Airbnb 页面;以下是所有受支持的采集器及其对应值的概览。 source 值。

来源
描述

airbnb_product

提交任何房间 ID 以抓取一个 房源页面.

airbnb

提交任何 Airbnb URL 即可。

入门

创建您的 API 用户凭据:注册免费试用,或在 Oxylabs 仪表板 创建您的 API 用户凭据(USERNAMEPASSWORD).

请求示例

curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "airbnb_product",
        "product_id": "11984394",
        "render": "html"
    }'
import requests
from pprint import pprint


# 结构化载荷。
payload = {
    'source': 'airbnb_product',
    'product_id': '11984394',
    'render': 'html'
}

# 获取响应。
response = requests.request(
    'POST',
    'https://realtime.oxylabs.io/v1/queries',
    auth=('USERNAME', 'PASSWORD'),
    json=payload
)

# 不会返回包含作业状态和结果 url 的响应,而是返回
# 包含结果的 JSON 响应。
pprint(response.json())

我们在示例中使用同步 Realtime 集成方法。如果您想使用 Proxy Endpoint 或异步 Push-Pull 集成,请参阅 集成方法 部分。

您还可以选择包含其他参数,例如 user_agent_type, render,以及更多内容来自定义您的抓取请求。了解更多:

功能

最后更新于

这有帮助吗?