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

URL

了解如何开始抓取 Bing URL。

bing source 旨在检索各种 Bing 页面直接 URL 的内容。你无需发送多个参数,只需提供所需 Bing 页面 的直接 URL。我们不会剥离任何参数,也不会以任何其他方式修改你的 URL。

请求示例

在这个示例中,我们发出一个请求来获取所提供 URL 的结果。

curl 'https://realtime.oxylabs.io/v1/queries' \\
--user 'USERNAME:PASSWORD' \\
-H 'Content-Type: application/json' \\
-d '{
        "source": "bing",
        "url": "https://www.bing.com/search?q=nike"
    }'
import requests
from pprint import pprint

# 结构化载荷。
payload = {
    'source': 'bing',
    'url': 'https://www.bing.com/search?q=nike'
}

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

# 不会返回包含作业状态和结果 url 的响应,而是返回
# 返回包含结果的 JSON。
pprint(response.json())
输出示例
{
    "results": [
        {
            "content": "<!DOCTYPE html>
            CONTENT
            </html>",
            "created_at": "2024-07-01 08:46:47",
            "updated_at": "2024-07-01 08:46:48",
            "page": 1,
            "url": "https://www.bing.com/search?q=nike",
            "job_id": "7213463035497697281",
            "status_code": 200
        }
    ]
}

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

请求参数值

参数
描述
默认值

source

设置抓取器。

bing

url

指向 Bing 页面 的直接 URL(链接)

-

render

设置为时启用 JavaScript 渲染 html. 更多信息.

-

解析

设置为以下值时返回解析后的数据: true。仅限特定 Bing 页面类型的 URL。

-

callback_url

回调端点的 URL。 更多信息

-

user_agent_type

设备类型和浏览器。完整列表可在 此处.

desktop

geo_location

指定搜索结果的位置。支持城市、州、国家或坐标格式。 阅读更多.

-

- 必填参数

最后更新于

这有帮助吗?