js

var graph ="";
function clickitem()
{
    var items = document.getElementsByName("load");
    var i;
    for (i = 0; i < items.length; i++)
    {
        if(items[i].text == "加载更多")
        {
            items[i].click();
            break;
        }
        else if(items[i].text == "显示子话题")
        {
             var dataparent = items[i].getAttribute("data-parent");
             console.log(dataparent);
            if(graph.indexOf(dataparent) == -1)
            {
                graph = graph + "," + dataparent;
                console.log(graph);
                items[i].click();
                break;
            }
        }
    }
    
}

 

posted @ 2018-11-27 00:20  skywss27  阅读(104)  评论(0编辑  收藏  举报