Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract Images From Zillow Home Views
/**
* Note: First, browser through all the images for the home. Then paste the following snippet into the console.
* Images will be saved to the download directory.
*/
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
$ = jQuery.noConflict();
var img = $('ul.photos li img').map(function(){return $(this).attr("src");});
img.map(function(idx){ $("body").append($("<a class='xyzxyz' href='"+img[idx]+"' download='"+img[idx].split('/')[4]+"' />")); console.log(idx); });
$('.xyzxyz').map(function(){ $(this)[0].click(); });
$('.xyzxyz').remove();
@bubsolow
Copy link

bubsolow commented Mar 15, 2020

@GGLionCross
Copy link

GGLionCross commented Jan 17, 2022

Had to adjust the script, but this worked for me:

/**
 *  Note: First, browser through all the images for the home.
 *  Then paste the following snippet into the console.
 *  Images will be saved to the download directory.
 */
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";

document.getElementsByTagName('head')[0].appendChild(jq);

// ... give time for script to load, then type.
$ = jQuery.noConflict();
function download(url, filename) {
  fetch(url)
    .then(response => response.blob())
    .then(blob => {
      const link = document.createElement("a");
      link.href = URL.createObjectURL(blob);
      link.download = filename;
      link.click();
  })
  .catch(console.error);
}
var img = $('ul.media-stream li img').map(function(){return $(this).attr("src");});
img.map(function(idx){ download(img[idx], idx+".jpg"); console.log(idx); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment