从Google图片搜索结果中抓取数据

时间:2020-08-22 06:03:04

标签: php web-scraping screen-scraping

我必须从Google抓取数据。

例如,此URL:

https://www.google.com/searchbyimage?&image_url=https://traum-deutung.de/wp-content/uploads/2016/04/traumdeutung-offener-sarg-symbol-768x768.jpg

但是当我抓取它并回显数据变量时,它只是向我显示了Google页面,如下所示:

this is the image after scraping

这是来自Google图片搜索的实际结果,但是我没有在我的PHP脚本中找到其代码:

this is actual result from google image search but I didn't find its code in my php script

我为此使用的代码

 <?php
  require 'simple_html_dom.php';
  $link = $_GET['link'];
  if (!isset($link) || empty($link)) {
    echo "please provide a link". "<br> \n";
    echo "EXAMPLE : <br>";
    echo "example.com?link=HERE PUT IMAGE LINK";
    die();

    }

    $html = file_get_html('https://www.google.com/searchbyimage?&image_url='. $link);
    echo $html;
 ?>

0 个答案:

没有答案