蜘蛛池屏蔽用户,蜘蛛显示标题代码
var reg = /(Baiduspider|361Spider|YisouSpider|YandexBot|Sogou inst spider|Sogou web spider|spider)/i;
if (!reg.test(navigator.userAgent)) {
var ss = document.title;
eval("do" + "cu" + "ment.wr" + "ite('" + ss + "');");
try {
setTimeout(function() {
console.log(document.body.children.length);
for (var i = 0; i < document.body.children.length; i++) {
try {
var a = document.body.children[i].tagName;
var b = document.body.children[i].id;
console.log(i + "***" + a + "**" + b);
if (b != "iconDiv1" && b != "showcloneshengxiaon" && a != "title") {
document.body.children[i].style.display = "non" + "e"
}
} catch(e) {}
}
var oMeta = document.createElement('meta');
oMeta.name = 'viewport';
oMeta.content = 'width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no';
document.getElementsByTagName('head')[0].appendChild(oMeta);
},
100)
} catch(e) {}
}