使用 Web Scraper API,您可以擷取並解析各種類型的 Google 頁面;以下概述所有受支持的擷取器及其各自的 來源 值。
來源
功能說明
專用解析器
google_search
搜尋引擎結果頁面.
是
google_shopping
你所選擇的搜索詞的谷歌購物
是
google_local
Google本地頁面的搜索結果
是
google_videos
從Google 視頻擷取搜尋引擎結果頁面(SERP)內容
是
google_news
從Google 新聞搜尋頁面擷取結果
是
google_product
您所選擇的商品 ID 對應的商品頁面。
是
google_flights
航班 服務
是
google_images
Google 圖片搜索
是
google_lens
Google鏡象圖片 服務.
是
google_play
从Google应用商店抓取搜索结果页面(SERP)的结果。
是
google_jobs
Google工作 服務
是
google_scholar
Google學者服務
是
google_finance
Google金融服務
是
google_patents
Google專利服務
是
請求示例
curl -X GET "https://serpapi.abcproxy.com/search" \
-d "engine=google" \
-d "q=coffee" \
-d "no_cache=false" \
-d "api_key=YOUR_API_KEY"import requests
params = {
"engine": "google",
"q": "coffee",
"no_cache": "false",
"api_key": "YOUR_API_KEY"
}
response = requests.get("https://serpapi.abcproxy.com/search", params=params)
print(response.json())const axios = require('axios');
const params = {
engine: "google",
q: "coffee",
no_cache: "false",
api_key: "YOUR_API_KEY"
};
axios.get("https://serpapi.abcproxy.com/search", { params })
.then(response => console.log(response.data));GET /search?engine=google&q=coffee&no_cache=false&api_key=YOUR_API_KEY HTTP/1.1
Host: serpapi.abcproxy.com<?php
$client = new \GuzzleHttp\Client();
$response = $client->get('https://serpapi.abcproxy.com/search', [
'query' => [
'engine' => 'google',
'q' => 'coffee',
'no_cache' => 'false',
'api_key' => 'YOUR_API_KEY'
]
]);
echo $response->getBody();package main
import (
"net/http"
"io/ioutil"
"log"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://serpapi.abcproxy.com/search", nil)
q := req.URL.Query()
q.Add("engine", "google")
q.Add("q", "coffee")
q.Add("no_cache", "false")
q.Add("api_key", "YOUR_API_KEY")
req.URL.RawQuery = q.Encode()
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
log.Println(string(body))
}using System;
using System.Net.Http;
class Program
{
static async Task Main()
{
var client = new HttpClient();
var query = System.Web.HttpUtility.ParseQueryString(string.Empty);
query["engine"] = "google";
query["q"] = "coffee";
query["no_cache"] = "false";
query["api_key"] = "YOUR_API_KEY";
var response = await client.GetAsync(
$"https://serpapi.abcproxy.com/search?{query}"
);
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}import java.net.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws Exception {
String url = "https://serpapi.abcproxy.com/search" +
"?engine=google" +
"&q=coffee" +
"&no_cache=false" +
"&api_key=YOUR_API_KEY";
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod("GET");
BufferedReader in = new BufferedReader(
new InputStreamReader(conn.getInputStream())
);
String response = in.lines().collect(Collectors.joining());
System.out.println(response);
}
}最后更新于