JS快速提取URL

控制台运行,快速提取页面url

Google

1
2
3
4
5
var i = document.getElementsByClassName('r');
for(var z=0;z<i.length;z++){
var url = i[z].getElementsByTagName('a');
console.log(url[0].href)
}

Bing

1
2
3
4
5
var h3 = document.getElementsByTagName('h2');
for(var i=0;i<h3.length;i++){
var a = h3[i]. getElementsByTagName('a');
console.log(a[0].href);
}

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×