// ==UserScript== // @name https://finder.susy.mdpi.com/reviewer // @namespace http://tampermonkey.net/ // @version 2024-05-23 // @description 提取 https://finder.susy.mdpi.com/reviewer // @author You // @match https://finder.susy.mdpi.com/reviewer* // @icon https://www.google.com/s2/favicons?sz=64&domain=google.com // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Your code here... try { const formtVal = (text) => { return text.replace(/\n/g, '').trim() } // statements const list = document.querySelectorAll('.job-ad-item'); const result = []; for (let i = 0; i < list.length; i++) { const el = list[i]; const Title = el.querySelector('.title').textContent; const Email = el.querySelector('.clipboard').getAttribute('data-clipboard-text'); let Interests = el.querySelector('.highlight-text').children[0].textContent.replace('Interests: ', ''); Interests = Interests?.includes('Keywords') ? '' : Interests; const Keywords = formtVal(el.querySelector('.show-more-section').textContent); const infoList = el.querySelectorAll('li'); const locationText = infoList[0]?.textContent || ''; const Location = formtVal(locationText?.split('\n')[1]); const Link = infoList[1]?.querySelector('a').textContent || ''; result.push({ Title, Email, Interests, Keywords, Location, Link }); } console.log(`%c提取结果:url-${location.href}`, 'color: red', result); } catch(e) { // statements console.log('提取失败'); } })();