Documentation has been updated: see help center and changelog in one place.

Proxy Endpoint

通过 Oxylabs 网页爬虫 API 的代理端点发送和接收数据。通过简单的基于 URL 的集成直接访问目标页面。

如果您曾经将常规代理用于数据抓取,那么集成 Proxy Endpoint 传输方式将非常简单。您只需将我们的入口节点用作代理,使用 Scraper API 凭据进行授权,并忽略证书。在 cURL,它是 -k--insecure。您的数据将通过一个开放连接到达您处。

Proxy Endpoint 仅适用于基于 URL 的数据源,其中提供了完整的 URL。因此,它只接受少数额外的作业参数,这些参数 应作为头部发送.

端点

GET realtime.oxylabs.io:60000

输入

请参见下面的请求示例。

curl -k -x https://realtime.oxylabs.io:60000 \
-U 'USERNAME:PASSWORD' \
-H 'x-oxylabs-user-agent-type: desktop_chrome' \
-H 'x-oxylabs-geo-location: Germany' \
'https://www.example.com'

输出

下面您将看到来自 https://example.com:

示例响应
<!doctype html>
<html>
<head>
    <title>Example Domain</title>

    <meta charset="utf-8" />
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <style type="text/css">
    body {
        background-color: #f0f0f2;
        margin: 0;
        padding: 0;
        font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
        
    }
    div {
        width: 600px;
        margin: 5em auto;
        padding: 2em;
        background-color: #fdfdff;
        border-radius: 0.5em;
        box-shadow: 2px 3px 7px 2px rgba(0,0,0,0.02);
    }
    a:link, a:visited {
        color: #38488f;
        text-decoration: none;
    }
    @media (max-width: 700px) {
        div {
            margin: 0 auto;
            width: auto;
        }
    }
    </style>    
</head>

<body>
<div>
    <h1>Example Domain</h1>
    <p>该域名用于文档中的说明性示例。您可以在文献中使用此
    域名,无需事先协调或请求许可。</p>
    <p><a href="https://www.iana.org/domains/example">更多信息...</a></p>
</div>
</body>
</html>

可接受的参数

在发出请求时,除了 URL 外,您还可以向我们发送一些在执行任务时使用的作业参数。作业参数应在您的请求头中发送 - 参见示例 此处.

以下是您可以随 Proxy Endpoint 请求一起发送的作业参数列表:

参数
说明

x-oxylabs-user-agent-type

无法指定具体的 User-Agent 字符串,但您可以告诉我们希望使用哪种 user-agent 类型。受支持的 User-Agent 类型列表可在 此处.

x-oxylabs-geo-location

在某些情况下,您可能需要指明结果应适配的地理位置。此参数对应于 geo_location 参数,其在源级文档中另行描述。可接受的值取决于您希望我们抓取的 URL。阅读更多 此处.

x-oxylabs-render

JavaScript 执行。阅读更多 此处.

最后更新于

这有帮助吗?