Created
July 14, 2020 12:28
-
-
Save smallfield/88fa32b022df99166f51e9a35fdbf126 to your computer and use it in GitHub Desktop.
dicks画像表示
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 imgLinks=document.querySelectorAll("picture img.img-fluid"); | |
imgLinks.forEach((img_tag,index)=>{ | |
const url=img_tag.src; | |
const parent=document.querySelector(".col-12.title.product-title"); | |
const link=document.createElement("a"); | |
console.log(img_tag.src.replace(/\?.$/i,"?wid=1200&hei=1200")); | |
link.href=url.replace(/\?.*$/i,"?wid=1200&hei=1200"); | |
link.target="_blank"; | |
link.download=true; | |
link.innerHTML="Download"+(index+1); | |
parent.appendChild(link); | |
parent.appendChild(document.createElement("br")); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment