javascript 获取知乎专辑章节页面的图片链接

    技术2022-07-10  116

    // ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://www.zhihu.com/market/albums/*/manuscript/* // @grant none // ==/UserScript== (function() { 'use strict'; let m = document.createElement("button"); m.innerText="GetPicture" m.style.cssText = "position:fixed;right:15px;top:10px;z-index:10001;padding:5px 10px;font-size:12px;"; document.body.append(m); m.onclick=function(){ var imgs = document.querySelectorAll("figure.central"); var str=''; for(var i=0;i<imgs.length;i++){ str+=imgs[i].firstChild.outerHTML; str+="\n" }; console.log(str); }; })();
    Processed: 0.027, SQL: 9