嗨请检查https://jsfiddle.net/9b0wL9tn/
jQuery的
$(document).ready(function(){
$('a').each(function(){
console.log($(this).attr('href'));
});
});
注意:在Chrome中打开网站>>右键点击>>检查>>转到控制台选项卡并粘贴以下内容并按下回车键
运行该代码首先在控制台上:
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type.
jQuery.noConflict();
然后运行这个
$('a').each(function(){
console.log($(this).attr('href'));
});
这会列出该网页上的所有链接只是把它从控制台
更新复制
家继上一个步骤后更新脚本...在控制台中运行以下脚本:
var arr=new Array();
jQuery('a').each(function(i){
arr[i]=jQuery(this).attr('title')+"";
});
jQuery.each(arr,function(i){
if(arr[i].indexOf('http')>-1)
console.log(arr[i].substr(0, arr[i].indexOf('-')));
});
这里是截图:http://www.imageno.com/lj7tuyr9pt2opic.html
来源
2016-04-21 06:10:46
RRR
当我粘贴后的代码到控制台,并按下回车,我(...)(匿名函数)@ VM214:2InjectedScript._evaluateOn @ VM90:878InjectedScript._evaluateAndWrap @ VM90:811InjectedScript.evaluate @@ VM904: VM90:667“ – prakharjain
也许这是因为该网站使用jQuery – RRR
或将此扩展程序添加到您的Chrome https://chrome.google.com/webstore/detail/jquerify/gbmifchmngifmadobkcpijhhldeeel kc?hl = en – RRR