Skip to content

Instantly share code, notes, and snippets.

@sinancan34
Last active July 12, 2020 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinancan34/339f801968618ff373989b584e969601 to your computer and use it in GitHub Desktop.
Save sinancan34/339f801968618ff373989b584e969601 to your computer and use it in GitHub Desktop.
var images = [];
document.querySelectorAll('a.serp-item__link').forEach(function(i){
var href = i.href;
var splt1 = href.split('img_url=');
var splt2 = splt1[1].split('&');
var image_url = decodeURIComponent(splt2[0]);
images.push(image_url);
});
var _html = document.querySelector('html');
_html.remove();
var html = document.createElement("html");
window.document.appendChild(html);
images.forEach(function(i){
var img = document.createElement("img");
img.src = i;
html.appendChild(img);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment