Last active
September 21, 2016 10:03
-
-
Save noname007/288a76520252d48b17586b73603e446b to your computer and use it in GitHub Desktop.
js 抓取页面 a标签,文本长度大于6
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var as = document.getElementsByTagName('a'); | |
var i = 0,j = as.length; | |
for(i=0;i<j;++i){ | |
if(as[i].innerText !="" && as[i].innerText.length > 5) | |
console.log(i,as[i].href,as[i].innerText) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment