已入深夜,您辛苦了!由于当前在线用户较少,发布求助请尽量完整地填写文献信息,科研通机器人24小时在线,伴您度过漫漫科研夜!祝你早点完成任务,早点休息,好梦!

wiley补充资料的快速下载方法

搜索技巧 5329 0 2
molihuakai
molihuakai 来自四川, 发表于:2026-06-16 20:20:59

Wiley 补充材料批量打包下载

右侧黑白灰面板 · 自动提取文件名 · 一键打包 ZIP
版本:v1.4 
匹配 *.onlinelibrary.wiley.com/*
授权 MIT
作者 定制脚本 · DeepSeek 辅助
 
 
 
⬆ 右侧浮动面板 · 自动识别补充材料链接
 

1 使用方法

在 Wiley 文章页面,脚本会自动在右上角生成控制面板,无需额外操作。

  • 1 安装脚本管理器 —— 推荐 脚本猫 或 Tampermonkey,确保已启用。
  • 2 添加用户脚本 —— 将下方完整代码复制到脚本管理器中,保存并启用。(@match 已适配 Wiley 域名)
  • 3 访问 Wiley 文章页 —— 任意包含 action/downloadSupplement?doi= 链接的页面,面板会自动出现。
  • 4 勾选文件 → 一键打包 —— 点击 「打包下载选中文件」,ZIP 将自动下载,文件名取自 file= 参数。

2 完整脚本代码

复制以下代码到脚本管理器,保存即用。

// ==UserScript==
            // @name         Wiley 补充材料批量打包下载(右侧黑白灰+file命名)
            // @namespace    http://tampermonkey.net/
            // @version      1.4
            // @description  修复面板不显示问题,右侧黑白灰样式,提取file=文件名,文件直放ZIP根目录
            // @author       定制脚本
            // @match        https://*.onlinelibrary.wiley.com/*
            // @grant        none
            // @require      https://cdn.jsdelivr.net/npm/jszip@3.10.1/dist/jszip.min.js
            // @require      https://cdn.jsdelivr.net/npm/file-saver@2.0.5/dist/FileSaver.min.js
            // @license      MIT
            // ==/UserScript==

            (function() {
                'use strict';

                // 解析 file= 参数获取文件名
                const getFileName = (url) => {
                    let name = '';
                    const fileMatch = url.match(/file=([^&]+)/);
                    if (fileMatch && fileMatch[1]) {
                        name = decodeURIComponent(fileMatch[1]);
                    } else {
                        const fnMatch = url.match(/filename=([^&]+)/);
                        name = fnMatch ? decodeURIComponent(fnMatch[1]) : '';
                    }
                    return name.replace(/[\\/:*?"<>|]/g, '_') || 'unknown_file';
                };

                // 创建控制面板
                function createPanel(links) {
                    if (document.getElementById('wiley_supplement_panel')) return;

                    const panel = document.createElement('div');
                    panel.id = 'wiley_supplement_panel';
                    panel.style.cssText = `
                        position: fixed; top: 20px; right: 20px; z-index: 999999;
                        background: #f8f8f8; border: 1px solid #ccc; border-radius: 6px;
                        padding: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
                        font-size: 14px; width: 320px; color: #333;
                    `;

                    const title = document.createElement('div');
                    title.textContent = `📦 补充材料打包下载 (${links.length} 个文件)`;
                    title.style.fontWeight = 'bold';
                    title.style.marginBottom = '8px';
                    title.style.color = '#222';
                    panel.appendChild(title);

                    const selectBtn = document.createElement('button');
                    selectBtn.textContent = '全选 / 反选';
                    selectBtn.style.margin = '0 5px 8px 0';
                    selectBtn.style.padding = '4px 8px';
                    selectBtn.style.border = '1px solid #999';
                    selectBtn.style.background = '#eee';
                    selectBtn.style.color = '#333';
                    selectBtn.style.borderRadius = '3px';
                    selectBtn.style.cursor = 'pointer';
                    panel.appendChild(selectBtn);

                    const downloadBtn = document.createElement('button');
                    downloadBtn.textContent = '✅ 打包下载选中文件';
                    downloadBtn.style.background = '#666';
                    downloadBtn.style.color = '#fff';
                    downloadBtn.style.border = '1px solid #555';
                    downloadBtn.style.borderRadius = '3px';
                    downloadBtn.style.padding = '4px 12px';
                    downloadBtn.style.cursor = 'pointer';
                    panel.appendChild(downloadBtn);

                    const fileList = document.createElement('div');
                    fileList.style.maxHeight = '200px';
                    fileList.style.overflowY = 'auto';
                    fileList.style.marginTop = '8px';
                    fileList.style.borderTop = '1px solid #ddd';
                    fileList.style.paddingTop = '8px';
                    panel.appendChild(fileList);
                    document.body.appendChild(panel);

                    const checkboxes = [];
                    links.forEach((link) => {
                        const fileName = getFileName(link.href);
                        const item = document.createElement('div');
                        item.style.margin = '3px 0';

                        const checkbox = document.createElement('input');
                        checkbox.type = 'checkbox';
                        checkbox.checked = true;
                        checkbox.value = link.href;

                        const label = document.createElement('span');
                        label.textContent = fileName;
                        label.style.marginLeft = '5px';

                        item.appendChild(checkbox);
                        item.appendChild(label);
                        fileList.appendChild(item);
                        checkboxes.push(checkbox);
                    });

                    // 全选反选
                    let isAllChecked = true;
                    selectBtn.onclick = () => {
                        isAllChecked = !isAllChecked;
                        checkboxes.forEach(cb => cb.checked = isAllChecked);
                    };

                    // 打包下载
                    downloadBtn.onclick = async () => {
                        const selected = checkboxes.filter(cb => cb.checked).map(cb => cb.value);
                        if (selected.length === 0) {
                            alert('请至少选择一个文件');
                            return;
                        }

                        downloadBtn.textContent = '⏳ 正在打包,请稍等...';
                        downloadBtn.disabled = true;

                        const zip = new JSZip();
                        const doi = location.pathname.split('/doi/')[1]?.replace(/\//g, '.') || 'wiley-supplements';

                        for (const url of selected) {
                            try {
                                const fileName = getFileName(url);
                                const res = await fetch(url, { mode: 'cors' });
                                const blob = await res.blob();
                                zip.file(fileName, blob);
                            } catch (e) {
                                console.warn('文件获取失败:', url, e);
                            }
                        }

                        zip.generateAsync({ type: 'blob' }).then(blob => {
                            saveAs(blob, `补充材料_${doi}.zip`);
                            downloadBtn.textContent = '✅ 打包下载完成';
                            setTimeout(() => {
                                downloadBtn.textContent = '✅ 打包下载选中文件';
                                downloadBtn.disabled = false;
                            }, 2000);
                        });
                    };
                }

                // 轮询检测异步加载的链接
                function checkLinks() {
                    const supplementLinks = Array.from(document.querySelectorAll('a[href*="action/downloadSupplement?doi="]'));
                    if (supplementLinks.length > 0) {
                        createPanel(supplementLinks);
                        return true;
                    }
                    return false;
                }

                // 初次检测 + 定时轮询
                if (!checkLinks()) {
                    const timer = setInterval(() => {
                        if (checkLinks()) {
                            clearInterval(timer);
                        }
                    }, 800);
                }

            })();

 


本帖完毕 ,最后编辑于:2026-06-16 20:47:52
回帖
  • 等待你,消灭零评论
科研通是完全免费的文献互助平台,具备全网最快的应助速度,最高的求助完成率。 对每一个文献求助,科研通都将尽心尽力,给求助人一个满意的交代。
实时播报
酷波er的应助被邢绿凝采纳,获得10
刚刚
Kiven完成签到,获得积分10
1秒前
fxl完成签到,获得积分10
2秒前
mycoplasma完成签到 ,获得积分10
2秒前
hhhhh完成签到 ,获得积分10
3秒前
赛赛完成签到 ,获得积分10
3秒前
3秒前
choup53发布了新的文献求助30
4秒前
Zzzz完成签到 ,获得积分10
5秒前
碧蓝幼菱完成签到 ,获得积分10
5秒前
硫酸盐完成签到,获得积分10
5秒前
勤恳八宝粥完成签到 ,获得积分10
6秒前
心中完成签到,获得积分10
6秒前
泥人满完成签到,获得积分10
6秒前
周周周周周完成签到 ,获得积分10
6秒前
6秒前
ttt完成签到,获得积分10
8秒前
8秒前
8秒前
Milktea123完成签到,获得积分10
8秒前
平息完成签到 ,获得积分10
10秒前
Bin_Liu完成签到,获得积分20
11秒前
善良的嫣发布了新的文献求助10
12秒前
Yyyyy完成签到 ,获得积分10
12秒前
肉卷完成签到 ,获得积分10
12秒前
kdjc完成签到 ,获得积分10
13秒前
Benjamin完成签到 ,获得积分0
13秒前
choup53完成签到,获得积分10
14秒前
bibai28对应助文件撤销了驳回
14秒前
学术bug发布了新的文献求助10
14秒前
kk_1315完成签到,获得积分0
14秒前
w1x2123完成签到,获得积分0
15秒前
文献完成签到,获得积分10
15秒前
16秒前
orixero的应助被硫酸盐采纳,获得10
17秒前
ljx完成签到 ,获得积分10
17秒前
kai完成签到,获得积分10
17秒前
雉鸥完成签到 ,获得积分10
18秒前
MOKO完成签到,获得积分10
18秒前
她不让我通宵学完成签到,获得积分10
18秒前
热门帖子
关注 科研通微信公众号,转发送积分 8189866
求助须知:如何正确求助?哪些是违规求助? 9577019
关于积分的说明 21851254
捐赠科研通 7787798
什么是DOI,文献DOI怎么找? 3435795
关于科研通互助平台的介绍 2559856
邀请新用户注册赠送积分活动 2482699
最新评论
互助平台共享信息 1小时前
太棒了,很好用的网站 2小时前
互助平台共享信息 4小时前
互助平台共享信息 7小时前
互助平台共享信息 7小时前
申请工单不耽误举报,反之亦然😜举报之后求助人会收到提醒“您的文献求助涉嫌违规正在被其它用户举报”,也算提醒一下对方了。 10小时前
互助平台共享信息 1天前
互助平台共享信息 1天前