// ==UserScript== // @name 专利列表下载 // @namespace http://tampermonkey.net/ // @version 2.6 // @description 下载企查查、爱企查、天眼查的专利列表,需要是显示出来的部分,如果有多页需要手动点,然后多次下载。 // @author angeljhon // @match *://www.qcc.com/*/* // @match *://www.tianyancha.com/*/* // @match *://aiqicha.baidu.com/* // @grant none // @license MIT // @downloadURL none // ==/UserScript== (function() { 'use strict'; // Create a new button element const button = document.createElement('button'); button.innerText = '下载'; // Change the button style button.style.backgroundColor = 'black'; button.style.color = 'white'; button.style.position = 'fixed'; button.style.bottom = '20px'; button.style.right = '5px'; button.style.zIndex = '9999'; button.style.width ='60px'; button.style.height = '30px'; // Add the button to the page document.body.appendChild(button); // Add a click event listener to the button button.addEventListener('click', () => { //window.location.href='<%=basePath%>pmb/excelShowInfo.do'; //获取表格 var dl_name="专利列表.xls"; var c_name=""; var exportFileContent; try{ var e_s=document.querySelector("#zhuanlilist") //exportFileContent =e_s.getElementsByTagName("table")[0].outerHTML; exportFileContent =e_s.querySelector("table.ntable").outerHTML; // exportFileContent = document.querySelector("div.tablist:nth-child(1) > div:nth-child(2) > table:nth-child(1)").outerHTML; c_name =document.querySelector("h1.copy-value").textContent; dl_name=c_name+"_企查查_专利列表.xls"; //alert(c_name); }catch(err){ try{ var targetText="专利名称"; var ts_e= document.getElementsByClassName('table-wrap'); ww1:{ for(var i=0;i