Share excellent template plug-in resources
Current position: home page > Website Design >Js code grabs all image URLs of the page, saves them to the txt file, and downloads them locally (javascript saves the file locally)

Js code grabs all image URLs of the page, saves them to the txt file, and downloads them locally (javascript saves the file locally)

Author: blueleaf Classification: Website Design Time: February 4, 2024 Browse: 566

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 grabs all image URLs of the page, saves them to the txt file, and downloads them to the local. png

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!

Comment List
 blink the eyes kiss Growl happy think poor It's embarrassing Grievance ha-ha hush Right hum Zuo Hum Hum doubt A bad laugh Make money Sadness Be cool Seduce fierce handshake yeah Hee hee Shyness applause greedy Madness Embrace gather and watch Mighty awesome
Submit comments

Clear information
Close Comment