Created
October 13, 2017 08:50
-
-
Save ShawonAshraf/1f2bc18425a58258bacdd8feddcf14e9 to your computer and use it in GitHub Desktop.
Download images from Google image search
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
// taken from | |
// https://32hertz.blogspot.com/2015/03/download-all-images-from-google-search.html | |
var cont=document.getElementsByTagName("body")[0]; | |
var imgs=document.getElementsByTagName("a"); | |
var i=0;var divv= document.createElement("div"); | |
var aray=new Array();var j=-1; | |
while(++i<imgs.length){ | |
if(imgs[i].href.indexOf("/imgres?imgurl=http")>0){ | |
divv.appendChild(document.createElement("br")); | |
aray[++j]=decodeURIComponent(imgs[i].href).split(/=|%|&/)[1].split("?imgref")[0]; | |
divv.appendChild(document.createTextNode(aray[j])); | |
} | |
} | |
cont.insertBefore(divv,cont.childNodes[0]); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment