各位大佬好
我在遍历网页元素的console里可以输出 list[0]
油猴脚本里就无法输出list,能请各位大佬帮忙看看嘛
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://wangda.chinamobile.com/
// @icon https://www.google.com/s2/favicons?domain=segmentfault.com
// @grant none
// ==/UserScript==
(function() {
alert('HelloWorld');
console.log('test');
var list = document.getElementsByClassName('item sub-text')
console.log('这是测试1',list);
console.log('这是测试2',list[0]);
if (document.getElementsByClassName('item sub-text')[0].innerText=='文档')
{
console.log('这是文档阅读');
window.setInterval(function(){
document.getElementsByClassName('item sub-text')[document.getElementsByClassName('item sub-text').length-1].click();
for(var i = 0; i