获取页面所有a标签href

for(i=0;i<=document.getElementsByTagName("a").length;i++){
console.log(document.getElementsByTagName("a")[i].href); //输出该页面的所有链接。
}

获取文本内容

var text = $('.content').text();console.log(text);

  

原文地址:https://www.cnblogs.com/qing1304197382/p/10441559.html