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

QFC

了解如何开始抓取 QFC。

使用 网页爬虫API,您可以抓取各种类型的 QFC 页面;下面是所有受支持爬虫及其各自 source 值的概览。响应会在 content中返回页面 HTML,采用 Realtime 和 Push-Pull.

Source
说明

qfc_search

搜索页 用于您选择的搜索词。

qfc_product

商品页 用于您选择的商品 ID。

任何其他 QFC 页面都可以通过传递其 url 即可抓取,无需 source 其他参数。

除了下面列出的参数外,您还可以添加其他参数,例如 user_agent_type, geo_location, render等,以自定义您的抓取请求。更多信息见 这里.

搜索

请求示例

curl 'https://realtime.oxylabs.io/v1/queries' \
--user 'USERNAME:PASSWORD' \
-H 'Content-Type: application/json' \
-d '{
        "source": "qfc_search",
        "query": "milk"
    }'
import requests
from pprint import pprint

# Structure payload.
payload = {
    'source': 'qfc_search',
    'query': 'milk'
}

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

# Instead of response with job status and results url, this will return the
# JSON response with the result.
pprint(response.json())

请求参数值

参数
说明
默认值

source

设置抓取器。

qfc_search

query

要搜索商品的关键词或短语。

-

store_id, delivery_zip, fulfillment_type, price_range, brand

可选的本地化和过滤参数,见 本地化和过滤.

-

- 必填参数

商品

请求示例

请求参数值

参数
说明
默认值

source

设置抓取器。

qfc_product

product_id

13 位商品 ID,可在商品页 URL 末尾找到,例如 qfc.com/p/kroger-carbmaster-original-lactose-free-skim-milk/0001111016338.

-

store_id, delivery_zip, fulfillment_type

可选的本地化参数,见 本地化和过滤.

-

- 必填参数

本地化和过滤

QFC 会显示所选门店或配送区域的搜索结果和商品可用性。如果下方参数都未设置,网站会回退到其自行选择的门店。

参数
适用于
说明
默认值

store_id

qfc_search, qfc_product

选择门店。ID 是 qfc.com 上门店页面 URL 中的分区编号和门店编号,连接如下: …/stores/grocery/wa/north-bend/north-bend/705/00829 → 70500829在以下情况时必填 fulfillment_type is pickup 或 in_store.

-

delivery_zip

qfc_search, qfc_product

配送区域的 ZIP code,例如 98101在以下情况时必填 fulfillment_type is delivery.

-

fulfillment_type

qfc_search, qfc_product

配送方式。可用值: pickup, delivery, in_store. pickup 和 in_store 需要 store_id; delivery 需要 delivery_zip.

in_store 与 store_id 单独, delivery 与 delivery_zip 单独

price_range

qfc_search

价格筛选器,格式为 min_price-max_price ,保留两位小数,例如 2.00-5.00.

-

brand

qfc_search

将结果筛选为某个品牌,例如 Fairlife.

-

如果 fulfillment_type 在未设置其所需参数的情况下设置,则结果会返回 status_code 400。一个 store_id QFC 之外的某个门店,或一个 delivery_zip 超出其配送区域的,会返回 status_code 613.

最后更新于

这有帮助吗?