URL 采集(Google)

google:

1
2
3
4
5
var h3 = document.getElementsByTagName('h3');
for(var i=0;i<h3.length;i++){
var a = h3[i]. getElementsByTagName('a');
console.log(a[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);
}

------本文结束,感谢阅读------