How to extract all images to a folder on the desktop using google using scripts?

Just like Mark Zuckerberg in the movie, the social network ripped out pictures from different cases.

Answer 1, authority 100%

Gee, here you can =)
JS can be successfully parsed. There right on the page there are 1) pictures like

<img class=rg_i name=Swj3qpAyTftgaM: [...]

and 2) there is a div that has an object that has options. in our case

<div id=hd_1 style="display:none">{"Swj3qpAyTftgaM:":["/imgres?imgurl\x3d[...

From x3d to the next x3d is our URL. Another thing is that I won’t write a parser here, because you can’t take it with regular expressions, but using strpos with your hands is a chore. I gave a hint.

UPDPlease. php(allow external file_get_contents):

$path = '-----';
$str = file_get_contents('--');
$images = parseGoogleImages($str); //   , ARRAY
$imgNum = 0;
$ext = '';
foreach ($images as $url) {
  $img = file_get_contents($url);
  if (!$img) {
    echo '<b>Error #1</b> with url <b>'.$url.'</b><br />';
    } else {
    $ext = $url;
    while (strpos($ext, '.') !== false)
      $ext = substr($ext, strpos($ext, '.')+1);
    if (!file_put_contents($path.'\\'.$imgNum.'.'.$ext, $img)) {
      echo '<b>Error #2</b> with url <b>'.$url.'</b><br />';
      } else echo 'Url<b>'.$url.'</b> loaded to <b>'.$path.'\\'.$imgNum.'.'.$ext.'</b><br />';


Answer 2

In php or perl, this is unlikely to work, where images are loaded using javascript. You can write an extension to your favorite browser in javascript that will collect image addresses, and the result will be passed to a script that downloads from addresses (you can implement it in php or perl).