Proxy Endpoint

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

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

Proxy Endpoint 仅适用于基于 URL 的数据源,在这些数据源中提供完整的 URL。因此,它只接受少量额外的作业参数, 应以请求头的形式发送.

circle-exclamation

Endpoint

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:

chevron-right示例响应hashtag
<!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>This domain is for use in illustrative examples in documents. You may use this
    domain in literature without prior coordination or asking for permission.</p>
    <p><a href="https://www.iana.org/domains/example">More information...</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 执行。阅读更多 这里.

最后更新于

这有帮助吗?