Bing

可以使用直接 URL 或使用 Bing 搜索栏的查询参数来定位 Bing。

bing

可解析: 是
必需参数: url
可选参数: geo (City,Region,Country), device_type, session_id

通过向 url 参数提供完整的 Bing URL 来检索 Bing 搜索引擎结果页面。在这种情况下,可以在 URL 本身中指定其他参数。

curl -u SPusername:SPpassword -X POST --url https://scraper-api.smartdaili-china.com/v2/scrape -H "Content-Type: application/json" -d "{\"target\": \"bing\", \"url\": \"https://www.bing.com/search?q=history\", \"parse\": \"true\"}"
import requests

task_params = {
    'target': 'bing',
    'url': 'https://www.bing.com/search?q=history',
    'parse': True
}

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' => 'bing',
    'url' => 'https://www.bing.com/search?q=history',
    'parse' => true
);

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

bing_search

可解析: 是
必需参数: query
可选参数: domain, page_from, num_pages, locale, geo (City,Region,Country), device_type, session_id

通过向查询参数提供你的查询,从 Bing 搜索引擎结果页面检索 HTML。

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

task_params = {
    'target': 'bing_search',
    'query': 'history',
    'parse': true
}

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' => 'bing_search',
    'query' => 'history',
    'parse' => true
);

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