Wayfair

可以使用直接 URL、向 Wayfair 搜索栏提供查询参数或提供 Wayfair 产品 ID 来定位 Wayfair。

wayfair

可解析: 否
必需参数: url
可用参数: device_type, session_id

通过向 url 参数提供完整的 Wayfair URL,从 Wayfair 检索 HTML。在这种情况下,可以在 URL 本身中指定其他参数。

curl -u SPusername:SPpassword -X POST --url https://scraper-api.smartdaili-china.com/v2/scrape -H "Content-Type: application/json" -d "{\"target\": \"wayfair\", \"url\": \"https://www.wayfair.com/rugs/pdp/highland-dunes-gunnell-30-x-18-non-slip-outdoor-door-mat-w005481595.html\", \"parse\": \"False\"}"
import requests

task_params = {
    'target': 'wayfair',
    'url': 'https://www.wayfair.com/rugs/pdp/highland-dunes-gunnell-30-x-18-non-slip-outdoor-door-mat-w005481595.html',
    'parse': False,
}

username = 'SPusername'
password = 'SPpassword'

response = requests.post(
    'https://scraper-api.smartdaili-china.com/v2/scrape',
    json = task_params,
    auth = (username, password)
)

print(response.text)
<?php

$params = array(
    'target' => 'wayfair',
    'url' => 'https://www.wayfair.com/rugs/pdp/highland-dunes-gunnell-30-x-18-non-slip-outdoor-door-mat-w005481595.html',
    'parse' => False
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://scraper-api.smartdaili-china.com/v2/scrape');
curl_setopt($ch, CURLOPT_USERPWD, 'SPusername' . ':' . 'SPpassword');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>

wayfair_search

可解析: 否
必需参数: query
可用参数: page_from, num_pages, device_type, session_id

通过向查询参数提供你的查询,从 Wayfair 检索 HTML。

curl -u SPusername:SPpassword -X POST --url https://scraper-api.smartdaili-china.com/v2/scrape -H "Content-Type: application/json" -d "{\"target\": \"wayfair_search\", \"query\": \"doormat\", \"parse\": \"False\"}"
import requests

task_params = {
    'target': 'wayfair_search',
    'query': 'doormat',
    'parse': False,
}

username = 'SPusername'
password = 'SPpassword'

response = requests.post(
    'https://scraper-api.smartdaili-china.com/v2/scrape',
    json = task_params,
    auth = (username, password)
)

print(response.text)
<?php

$params = array(
    'target' => 'wayfair_search',
    'query' => 'doormat',
    'parse' => False
);

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, 'https://scraper-api.smartdaili-china.com/v2/scrape');
curl_setopt($ch, CURLOPT_USERPWD, 'SPusername' . ':' . 'SPpassword');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_POST, 1);

$headers = array();
$headers[] = 'Content-Type: application/json';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

$result = curl_exec($ch);
echo $result;

if (curl_errno($ch)) {
    echo 'Error:' . curl_error($ch);
}
curl_close ($ch);
?>