Last active
July 12, 2020 19:23
-
-
Save sinancan34/339f801968618ff373989b584e969601 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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