企查查

企查查获取电话和地址

当前为 2022-06-25 提交的版本,查看 最新版本

// ==UserScript==
// @name         企查查
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  企查查获取电话和地址
// @author       Ying
// @match        https://www.qcc.com/web/*
// @grant        GM_setClipboard
// @license MIT
// ==/UserScript==

javascript: (function() {
var phone = document.createElement("input");
    phone.setAttribute("name","number");
    phone.setAttribute("id","jobs");
    phone.setAttribute("value","获取电话");
    phone.setAttribute("style","width:130px;height:45px;line-height:43px;box-sizing:border-box;vertical-align:middle;font-size:16px;font-weight:500;text-align:center;background:#5dd5c8;color:white;");
    $('.npanel-heading').append(phone);

    phone.onclick=function(){
        var nr = document.getElementsByTagName("tr")[1];
        var nt = nr.getElementsByTagName("td")[5];
        var pp = nt.getElementsByTagName("span")[3].innerHTML;
        GM_setClipboard(pp);
        console.log(pp)
    };

var tel = document.createElement("input");
    tel.setAttribute("name","number");
    tel.setAttribute("id","jobs");
    tel.setAttribute("value","获取地址");
    tel.setAttribute("style","width:130px;height:45px;line-height:43px;box-sizing:border-box;vertical-align:middle;font-size:16px;font-weight:500;text-align:center;background:#5dd5c8;color:white;");
    $('.npanel-heading').append(tel);

    tel.onclick=function(){
        var nr = document.getElementsByTagName("tr")[1];
        var nt = nr.getElementsByTagName("td")[8];
        var pp = nt.getElementsByTagName("span")[0].innerText;
        GM_setClipboard(pp);
        console.log(pp)
    };

})();