Bangumi 动漫信息获取脚本

in 实用教程技术文档 with 0 commentand 85 read

适用如链接例:https://bgm.tv/subject/XXX

包括信息:

bgm信息获取.png

将以下代码粘贴到控制台中

var bgmName = document.getElementsByClassName("nameSingle")[0].innerText;
var bgmDetails = document.getElementById("subject_summary").innerText;
var Ranked = document.getElementsByClassName("global_score")[0].innerText;
var infoText = "";
var infoTextSplit = document.getElementById("infobox").innerText.split("\n");
for (var i = 0; i < infoTextSplit.length; i++) {
 if (i < 6) {
  infoText += infoTextSplit[i] + "\n";
 }
}
console.log("[NAME]: " + bgmName + "\n\n[INFO]:\n" + infoText + "\n\n[DETAILS]:\n" + bgmDetails + "\n\n[RANKED]:\n" + Ranked);
Comments are closed.