SE::Google::ByImage - リンクによる画像検索

スクレイパー概要
Google画像検索(リンク指定)スクレイパーです。SE::Google::ByImageを使用することで、画像リンクのデータベースや、その後の利用に適した画像情報を取得できます。Googleの検索窓に入力するのと同様の形式でクエリを使用できます。
A-Parserの機能により、Googleスクレイピングの設定を将来の利用のために保存(プリセット)したり、スクレイピングのスケジュールを設定したりすることが可能です。自動クエリ増殖、ファイルからのサブクエリ挿入、英数字の組み合わせやリストの総当たりなどを使用して、最大限の検索結果を取得できます。
内蔵された強力なテンプレートエンジン Template Toolkit により、結果に独自のロジックを適用したり、JSON, SQL, CSVを含む様々なフォーマットでデータを出力したりと、必要な形式や構造で結果を保存できます。
スクレイパーのユースケース
リンクによる画像のダウンロード
A-Parserではジョブのチェーン(連携)が可能です。最初のジョブが完了すると2番目のジョブが開始され、最初のジョブで得られたリンクを2番目のジョブのクエリとして使用できます。
サンプルをダウンロード
eJyNVk1T2zAQ/SuMJofQgm0604svNKGlpUMJhXAKdEaNN65AlowkAxmT/95d2bHj
YGhv3tVqP98+uWSO2zt7bsCCsyyelSz33yxmX7VOJeyMlyLjKex81o9Kap6wPZZz
Y8GQ+YxdfonjyjKOx8sTMkWLBBa8kI7tlcwtc0Bv+gGMEQkdigTl3OinpQFnBFjU
PXBZkNlBFLHVzc0ewyzQgT3WJuOUzSA/COrUmsNL/gBTjYcLIaFVH6N0xjNyN0i4
AzoNFt7RcDdwT+SBJ4lwQisuqwhUTBv1Sol7n47F/FSK9ihSpsdGZ6h24J2QcrnO
cMYGXmbopvD3f1Z3WLzg0sIes5juMcdkku0T4cBwp80kp5xQXzKtRlKewgPI1sz7
HxdCJtj90QIvndQX+00mL3ysmhI3Q+FoHg3m0Hjx0njyo72V6FOdYuXJb6xbikw4
lO2RLhQNJ0LlHUDe9O1MoybTBpowzhTQBEe85aAIBu3URnmr6lTRmUxXOddqIdJJ
Da21ZaGmCOqJOtJZLoHKYh6XtsEwGAxSWLhoATOy9VBIaNLddnXkA1If1gBnTmtp
v19WiedGIB4/UroZtnUzh7q1cy7l1cVpJ7sWXyj8cS63cRjy/WrNgrnOQpGlodSp
3uf5pw9PQe4xOUdspxoRh2WvcNN6CleFlH174VfahhViA1Vk+4Oy/kaDVUDbVmF8
c9fPwMXxt+n0vLvh3Bi+rB37eabwNK22Xqxl/MZhOVBunwghDt4d+hzCIdbyfJvD
YfqcisUuNbS6Oi+s01k1oRYltGeUWIOIOtBC8taKugjcw4T6suYWpRWxhPaQpOUG
Zdt4yBLO46L6qP0q7eC+4HLTN8X3HNW7B30Q72WP/wHXmxiN2rVUegsPrwLtFep8
hQ+3F7FkVhdmTr4qsiP800wINtVQ+ocfDme/wpv3u9fXwfAw7s580A6hMl+9wv9I
5ryfMJpHq3fRu2wc9XFVs7jtIrJexo62Nr6XlzrMF718Vvy4XlJE9O+XIHr7Fdg+
7rwA0eqNJ6ufSt96K6LNd4J8+4bjQA5ofjVvNH8WZe+fQlzivZZWUET51p5Xlwnm
trLBsNZv7cHqL+EHA0s=
収集データ
- 画像へのリンク
- ページへのリンク
- スニペット
- アンカーテキスト
- 画像の幅と高さ
- 検索結果の件数
- クエリで指定されたリンク先の画像の幅と高さ
ユースケース
- 個人利用のための画像収集
- 画像データベースの構築
- 画像の説明文の収集
- 画像リンクの収集
クエリ
クエリとして、Google上の画像へのリンクを指定する必要があります。例:
https://a-parser.com/img/[email protected]
結果の出力例
A-Parserは内蔵されたテンプレートエンジン Template Toolkit により、柔軟な結果のフォーマットをサポートしています。これにより、任意の形式や、CSV、JSONなどの構造化された形式で結果を出力できます。
デフォルト出力
結果フォーマット:
$serp.format('$link\n')
結果の例:
https://en.a-parser.com/img/[email protected]
https://en.a-parser.com/img/[email protected]
https://en.a-parser.com/img/[email protected]
https://en.a-parser.com/img/[email protected]
https://proxylist4you.com/wp-content/uploads/2018/09/[email protected]
https://proxylist4you.com/wp-content/uploads/2018/09/[email protected]
CSVテーブルへの出力
結果フォーマット:
[% FOREACH item IN serp;
tools.CSVline(query, item.link, item.width, item.height, item.anchor, item.snippet);
END %]
結果の例:
https://a-parser.com/img/[email protected],https://en.a-parser.com/,812,168,,"A-Parser - scraper for SEO professionals","A-Parser - scraper of search engines, WordStat, Whois, PR, YouTube, Alexa, Ahrefs, MajesticSEO, etc."
https://a-parser.com/img/[email protected],https://en.a-parser.com/online/,812,168,,"Current Visitors | A-Parser - scraper for SEO professionals","This is a list of all visitors currently browsing A-Parser - scraper for SEO professionals."
https://a-parser.com/img/[email protected],https://en.a-parser.com/wiki/unique/,812,168,,"Usage of the unique feature | A-Parser - scraper for SEO ...","Unique, deduplication, removing duplicates - all this implies that we don't need the repeating results. In A-Parser is 2 methods of unique, we ..."
https://a-parser.com/img/[email protected],https://en.a-parser.com/pages/support/knowledge-base,812,168,,"Knowledge Base | A-Parser - scraper for SEO professionals","A-Parser has been built with a vast understanding of extracting and processing large volumes of information. We strive to produce only market leading software ..."
https://a-parser.com/img/[email protected],https://proxylist4you.com/,812,168,,"Private Residental Rotating Proxies – Buy Cheapest Private ...
SQL形式での保存
結果フォーマット:
[% FOREACH serp; "INSERT INTO serp VALUES('" _ query _ "', '"; link _ "', '"; anchor _ "', '"; snippet _ "')\n"; END %]
結果の例:
INSERT INTO serp VALUES('https://a-parser.com/img/[email protected]', 'https://en.a-parser.com/', 'A-Parser - scraper for SEO professionals', 'A-Parser - scraper of search engines, WordStat, Whois, PR, YouTube, Alexa, Ahrefs, MajesticSEO, etc.')
INSERT INTO serp VALUES('https://a-parser.com/img/[email protected]', 'https://en.a-parser.com/online/', 'Current Visitors | A-Parser - scraper for SEO professionals', 'This is a list of all visitors currently browsing A-Parser - scraper for SEO professionals.')
INSERT INTO serp VALUES('https://a-parser.com/img/[email protected]', 'https://en.a-parser.com/wiki/unique/', 'Usage of the unique feature | A-Parser - scraper for SEO ...', 'Unique, deduplication, removing duplicates - all this implies that we don't need the repeating results. In A-Parser is 2 methods of unique, we ...')
INSERT INTO serp VALUES('https://a-parser.com/img/[email protected]', 'https://en.a-parser.com/wiki/settings-and-presets/', 'Settings and presets | A-Parser - scraper for SEO professionals', 'Configs presets - settings of threads and methods of unique of tasks; Parsers presets - opportunity to set up each separate parcer; Proxy checker ...')
INSERT INTO serp VALUES('https://a-parser.com/img/[email protected]', 'https://proxylist4you.com/', 'Private Residental Rotating Proxies – Buy Cheapest Private ...', 'For you business is ready more than 11,000,000 unique monthly HTPP\HTTPS\Socks5\Socks4 Private Proxies from 170 countries all over the world with real ...')
結果のJSONダンプ
共通結果形式:
[% IF notFirst;
",\n";
ELSE;
notFirst = 1;
END;
obj = {};
obj.query = query;
obj.images = [];
FOREACH item IN p1.serp;
obj.images.push({
width = item.width
height = item.height
link = item.link
anchor = item.anchor
snippet = item.snippet
});
END;
obj.json %]
開始テキスト:
[
終了テキスト:
]
結果の例:
[{
"images": [
{
"link": "https://en.a-parser.com/",
"width": "812",
"snippet": "A-Parser - scraper of search engines, WordStat, Whois, PR, YouTube, Alexa, Ahrefs, MajesticSEO, etc.",
"anchor": "A-Parser - scraper for SEO professionals",
"height": "168"
},
{
"link": "https://en.a-parser.com/online/",
"width": "812",
"snippet": "This is a list of all visitors currently browsing A-Parser - scraper for SEO professionals.",
"anchor": "Current Visitors | A-Parser - scraper for SEO professionals",
"height": "168"
},
{
"link": "https://en.a-parser.com/wiki/unique/",
"width": "812",
"snippet": "Unique, deduplication, removing duplicates - all this implies that we don't need the repeating results. In A-Parser is 2 methods of unique, we ...",
"anchor": "Usage of the unique feature | A-Parser - scraper for SEO ...",
"height": "168"
},
{
"link": "https://en.a-parser.com/pages/support/knowledge-base",
"width": "812",
"snippet": "A-Parser has been built with a vast understanding of extracting and processing large volumes of information. We strive to produce only market leading software ...",
"anchor": "Knowledge Base | A-Parser - scraper for SEO professionals",
"height": "168"
},
{
"link": "https://proxylist4you.com/",
"width": "812",
"snippet": "For you business is ready more than 11,000,000 unique monthly HTPP\\HTTPS\\Socks5\\Socks4 Private Proxies from 170 countries all over the world with real ...",
"anchor": "Private Residental Rotating Proxies – Buy Cheapest Private ...",
"height": "168"
},
{
"link": "https://proxylist4you.com/index.php/buyprivateproxies/",
"width": "812",
"snippet": "Worldwide Mixed Residential Reverse Backconnect Rotating Private Proxies. This proxies support HTTP, HTTPS, Socks4, Socks5 protocols. · Worldwide ...",
"anchor": "All of our Proxy Packages – Private Residental Rotating Proxies",
"height": "168"
}
],
"query": "https://a-parser.com/img/[email protected]"
}]
「Prepend text」および「Append text」オプションをタスクエディタで表示するには、「More options」を有効にする必要があります。
設定可能な項目
| パラメータ | デフォルト値 | 説明 |
|---|---|---|
| Pages count | 5 | スクレイピングするページ数 |
| Google domain | www.google.com | スクレイピングに使用するGoogleドメイン。すべてのドメインをサポート |
| Util::ReCaptcha2 preset | default | Util::ReCaptcha2 スクレイパーのプリセット。事前に Util::ReCaptcha2 スクレイパーを設定(アクセスキーやその他のパラメータを指定)し、ここで作成したプリセットを選択する必要があります |
| Interface language | English | Googleのインターフェース言語の選択。スクレイパーとブラウザの結果を最大限一致させるために使用 |
| Results language | Auto (Based on IP) | 結果の言語選択(lr= パラメータ) |
| Search from country | Auto (Based on IP) | 検索を実行する国の選択(地域依存検索、gl= パラメータ) |
