eCommerce

通过向 URL 参数提供网站的完整 URL,从任何电商网站检索结果。在这种情况下,可以在 URL 本身中指定其他参数。

可解析: 大部分是 (使用AI解析器)
必需参数: url
可用参数: device_type, geo, headless, session_id, successful_status_codes, http_method, payload, headers, cookies

curl -u SPusername:SPpassword -X POST --url https://scraper-api.smartdaili-china.com/v2/scrape -H "Content-Type: application/json" -d "{\"target\": \"ecommerce\", \"url\": \"https://www.walmart.com/browse/electronics/tax-prep-tech/3944_4459033?povid=GlobalNav_rWeb_Electronics_TaxPrep_TaxPrepTech\", \"headless\": \"html\", \"http_method\": \"get\"}"
import requests

task_params = {
    'target': 'ecommerce',
    'url': 'https://www.walmart.com/browse/electronics/tax-prep-tech/3944_4459033?povid=GlobalNav_rWeb_Electronics_TaxPrep_TaxPrepTech',
    'headless': 'html',
    'http_method': 'get'
}

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' => 'ecommerce',
    'url' => 'https://www.walmart.com/browse/electronics/tax-prep-tech/3944_4459033?povid=GlobalNav_rWeb_Electronics_TaxPrep_TaxPrepTech',
    'headless' => 'html',
    'http_method' => 'get'
);

$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);
?>

📘

请注意,若要使用 AI 解析器获取结果,你需要将parse参数设置为true,并将parser_type参数设置为ecommerce_product