When browsing some Meitu websites, if you want to save Meitu, you need to use the right mouse button to save one image and one image as a local file. It is time-consuming, laborious, and unpleasant. If we can grab all the image URLs at one time, and then download them at one time through the download tool, it will be very convenient, So how can I grab all the picture URLs on the page, save them to a txt file, and download them locally?
Js code Grab all image URLs on the page, save them to a txt file, and download them locally, javascript Save the file locally, open the developer tool of Google Browser, paste the code below in the console, and then press Enter to grab all the files on the page jpg、jpeg、png、gif The ending picture URL is automatically downloaded and saved locally allimglinks.txt In the file, The format in the js code can be changed to the condition you want.
var allIMG=''; var allLink=document.body.getElementsByTagName("a"); for(i=0; i<allLink.length;i++){ if(allLink[i].href.match(/jpg|png|jpeg|gif/) != null){ allIMG +=allLink[i].href+"\r\n"; } } var blob = new Blob([allIMG], { type: "text/plain"}); var anchor = document.createElement("a"); anchor.download = "allimglinks.txt"; anchor.href = window.URL.createObjectURL(blob); anchor.target ="_blank"; anchor.style.display = "none"; document.body.appendChild(anchor); anchor.click(); document.body.removeChild(anchor);
Disclaimer:
Website: Click Copy to share with friends!
All content resources shared by this website, if not noted, are original by Blueleaf. If you need to reprint, please indicate the source; Please contact us in case of infringement Contact handling 。 Please understand!