Skip to content

Instantly share code, notes, and snippets.

@bryant988
Last active October 22, 2025 03:18
Show Gist options
  • Save bryant988/9510cff838d86dcefa3b9ea3835b8552 to your computer and use it in GitHub Desktop.
Save bryant988/9510cff838d86dcefa3b9ea3835b8552 to your computer and use it in GitHub Desktop.
Zillow Image Downloader
/**
* NOTE: this specifically works if the house is for sale since it renders differently.
* This will download the highest resolution available per image.
*/
/**
* STEP 1: Make sure to *SCROLL* through all images so they appear on DOM.
* No need to click any images.
*/
/**
* STEP 2: Open Dev Tools Console.
* Copy and paste code below
*/
const script = document.createElement('script');
script.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
script.onload = () => {
$ = jQuery.noConflict();
const imageList = $('ul.media-stream li picture source[type="image/jpeg"]').map(function () {
const srcset = $(this).attr('srcset').split(' '); // get highest res urls for each image
return srcset[srcset.length - 2]
}).toArray();
const delay = ms => new Promise(res => setTimeout(res, ms)); // promise delay
// get all image blobs in parallel first before downloading for proper batching
Promise.all(imageList.map(i => fetch(i))
).then(responses =>
Promise.all(responses.map(res => res.blob()))
).then(async (blobs) => {
for (let i = 0; i < blobs.length; i++) {
if (i % 10 === 0) {
console.log('1 sec delay...');
await delay(1000);
}
var a = document.createElement('a');
a.style = "display: none";
console.log(i);
var url = window.URL.createObjectURL(blobs[i]);
a.href = url;
a.download = i + '';
document.body.appendChild(a);
a.click();
setTimeout(() => {
window.URL.revokeObjectURL(url);
}, 100);
}
});
};
document.getElementsByTagName('head')[0].appendChild(script);
@reworkednyc
Copy link

reworkednyc commented Oct 14, 2025

It is mid-October 2025 and I'm running Firefox current version (143.0.4 64-bit for ARM64). I was happily surprised to find that the script works perfectly. I used the version @SabinVI posted three weeks ago. Below is the exact procedure I followed:

  1. Navigated to the listing page for the house, whose status is 'under contract' (note I was on the main listing page, not the lightbox)
  2. Scrolled to the very bottom of the page without jumping, so as to load every picture that is available
  3. In Firefox, select the 'Tools' menu => 'Browser Tools' => 'Web Developer Tools'
  4. Within the Dev Tools popup that opens there are several tabs across the top. Select the 'Console' tab. Hit the Trash icon to clear the workspace (this won't harm anything)
  5. Type 'allow pasting' into the dialog
  6. Paste the @SabinVI code into the dialog and hit 'return'
  7. Wait a second while the magic happens. You may see some error lines and 'Found Image URLs'.
  8. After about 5 seconds, Firefox presented me with the 'save file' option. The resulting download was a .zip containing all of the pictures from the listing in high-resolution (~225kb avg in my case).

I was happy to find the script made it easy to archive the images - thanks to everyone who took the time to advance and refine this helpful bit of code. I hope my pedantic write-up is of use to fellow Firefox users who may be equally unfamiliar with using .js in console.

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