试了很多插件,都不好用,然后就翻出了这个,老外的动手能力确实是强
步骤1:打开搜索设置
步骤2:将“每页结果数”设置为100
步骤3:打开控制台 【Chrome (Right Click –> Inspect)】
In Firefox (Right Click –> Inspect Element)
步骤#4:执行代码
现在必须执行以下两段代码。将4.1复制粘贴到console并按Enter键,然后将4.2复制粘贴到console并按Enter键。步骤#3中的图像还显示了此代码在粘贴之后和按下回车键之前的样子。
注意,4.1和4.2必须单独运行,因为4.1中的代码执行需要一秒钟,4.2节中的代码必须在4.1完成后才能执行。
步骤#4.1:导入jQuery
// Add jQuery from the console (if necessary) javascript: (function(e, s) { e.src = s; e.onload = function() { jQuery.noConflict(); console.log('jQuery injected'); }; document.head.appendChild(e); })(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js') // https://stackoverflow.com/questions/7474354/include-jquery-in-the-javascript-console
步骤#4.2:运行Scrape
var t = jQuery("#search .rc .r a"); // For Google queries function list_scraped_urls_google(t) { var tt = "<table>"; tt += "<thead><tr><td>SERP Pos.</td><td>URL</td><td>Title</td></tr></thead>"; tt += "<tbody>"; for (iii = 0; iii < t.length; ++iii) tt += "<tr><td>"+(iii+1)+"</td><td>" + t[iii] + "</td><td>" + t[iii].innerHTML + "</td>"; // For Google with Title Tags tt += "</tbody>"; display_output_onpage(tt); } function display_output_onpage(output) { // nl2br equivalent output = output.replace(/\n/g,"<br />"); // Create a new tab and display the output var winPrint = window.open('', '_blank', ''); winPrint.document.write(ghetto_styles()+'<title>SERP Result Data</title><body>'+output+"</body>"); winPrint.document.close(); } function ghetto_styles() { var t = '<style>' +'table { border: 2px solid black; width: 100%; background-color: #eeeeee;}' +'table { margin:2%; font-size: 90%; font-family:monospace; width: 96%; box-shadow: 2px 2px rgba(70,70,70,0.3);}' +'table thead tr { background-color: #6e6eed; text-align: center; color: white; font-weight: bold; }' +'table thead tr { font-size: 2em; text-shadow: 1px 1px rgba(30,30,40,0.7); }' +'table tr { background-color: #e0e0ff; }' +'table tr:nth-child(even) { background-color: #d0d0ff; }' +'table tr td:first-child { width:4%; font-weight:bold; }' +'table tr td { padding: 4px 12px; width:32%;}' +'</style>'; return t; } // EXECUTE CODE list_scraped_urls_google(t); // //</table>
步骤#5:复制粘贴到电子表格
使用Ctrl + A – > Ctrl + C轻松将其复制到电子表格