您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Extract titles, URLs, and descriptions from Google SERPs.
// ==UserScript== // @name Google SERP Parser // @namespace http://tampermonkey.net/ // @version 1.0 // @description Extract titles, URLs, and descriptions from Google SERPs. // @author YourName // @match https://www.google.*/*search?* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to extract and display search result data function parseSERP() { const results = []; document.querySelectorAll('div.g').forEach((resultElement) => { const title = resultElement.querySelector('h3') ? resultElement.querySelector('h3').innerText : 'No title'; const url = resultElement.querySelector('a') ? resultElement.querySelector('a').href : 'No URL'; const description = resultElement.querySelector('.VwiC3b') ? resultElement.querySelector('.VwiC3b').innerText : 'No description available'; results.push({title, url, description}); }); console.log(results); // Optionally, display the results in a more user-friendly way here } // Run the parser function when the page has loaded window.addEventListener('load', parseSERP); })();