afpbb 写真特集 wedata:75012

bookmarklet

var result = document.evaluate('//div[@class="gellary-thumb"]/img',document, null, 7, null);
var im_p =document.createElement("div");
im_p.id="test";
document.getElementById("mainimg").appendChild(im_p);

for(var i=0;i<result.snapshotLength;i++)
{
    var im =document.createElement("img");
    im.src=result.snapshotItem(i).src;
    document.getElementById("test").appendChild(im);
}

gresemonkey

// ==UserScript==
// @name         New Userscript
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  try to take over the world!
// @author       You
// @match        http://www.afpbb.com/articles/-/*
// @grant        none
// ==/UserScript==
while(document.getElementById("test")==null)
{
var result = document.evaluate('//div[@class="gellary-thumb"]/img',document, null, 7, null);
var im_p =document.createElement("div");
im_p.id="test";
document.getElementById("article-contents").appendChild(im_p);

for(var i=0;i<result.snapshotLength;i++)
{
    var im =document.createElement("img");
    im.src=result.snapshotItem(i).src;
    document.getElementById("test").appendChild(im);
}
   
}