Greasy Fork

提取finder.susy.mdpi.com

提取 https://finder.susy.mdpi.com/reviewer

目前为 2024-05-23 提交的版本。查看 最新版本

// ==UserScript==
// @name         提取finder.susy.mdpi.com
// @namespace    http://tampermonkey.net/
// @version      v1.0.0
// @description  提取 https://finder.susy.mdpi.com/reviewer
// @author       Cheese-Yu
// @match        https://finder.susy.mdpi.com/reviewer*
// @icon         https://finder.susy.mdpi.com/dist/images/ico/favicon.ico?5
// @grant        none
// @license MIT
// ==/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('提取失败');
    }
})();