知网批量下载PDF

用于知网批量下载PDF

  1. // ==UserScript==
  2. // @name 知网批量下载PDF
  3. // @namespace https://ixz.im/
  4. // @version 0.1
  5. // @description 用于知网批量下载PDF
  6. // @author Juicpt
  7. // @match *://*.cnki.net/*
  8. // @include *://*.cnki.net.*
  9. // @include *://*/cnki.net/*
  10. // @run-at document-end
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function () {
  15. 'use strict';
  16. const html = document.querySelector(".SavePoint");
  17. const button = document.createElement('a');
  18. const Util = {
  19. dflag: res => res.replace('&dflag=nhdown', '&dflag=pdfdown'),
  20.  
  21. };
  22. button.innerHTML = '批量下载PDF';
  23.  
  24. if (html) {
  25. html.style.width = '600px';
  26. html.appendChild(button);
  27.  
  28. }
  29. const table = document.querySelector('.GridTableContent');
  30. const tr = table.querySelectorAll('tr [bgcolor]');
  31. tr.forEach(
  32. res => {
  33. const a = res.querySelector('.briefDl_Y, .briefDl_D');
  34. a.href = a.href.match('&dflag') ? Util.dflag(a.href) : (a.href + '&dflag=pdfdown');
  35. }
  36. );
  37. button.addEventListener('click', () => {
  38. tr.forEach(
  39. res=>{
  40. const a = res.querySelector('.briefDl_Y, .briefDl_D');
  41. a.click();
  42. }
  43. )
  44. });
  45.  
  46. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址