You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何让Fetlife页面单页显示全量/更多结果(当前每页20条)

解决Fetlife页面每页显示条数限制及数据导出问题

一、临时修改每页显示条数(浏览器控制台)

  • 打开目标页面,按F12唤起开发者工具,切换到Console标签页
  • 执行以下代码,替换分页请求的条数参数(以per_page为例,部分网站参数名可能不同,可根据页面API请求调整):
    // 替换页面中所有分页链接的per_page参数为1000
    document.querySelectorAll('a[href*="per_page"]').forEach(link => {
      link.href = link.href.replace(/per_page=\d+/, 'per_page=1000');
    });
    // 拦截动态加载的API请求,修改分页参数
    const originalFetch = window.fetch;
    window.fetch = (...args) => {
      if (typeof args[0] === 'string' && args[0].includes('/members')) {
        args[0] = args[0].replace(/per_page=\d+/, 'per_page=1000');
      }
      return originalFetch(...args);
    };
    
  • 执行后刷新页面或点击分页按钮即可生效,若1000条无效,可尝试500、200等数值(部分网站后端会限制最大条数)

二、持久化修改(Tampermonkey油猴脚本)

如果需要每次访问页面自动修改,可编写油猴脚本:

// ==UserScript==
// @name         Fetlife 分页条数自定义
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  自动修改Fetlife成员列表每页显示条数
// @match        https://fetlife.com/p/australia/western-australia*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    // 更新分页链接参数
    function updatePageLinks() {
        document.querySelectorAll('a[href*="per_page"]').forEach(link => {
            link.href = link.href.replace(/per_page=\d+/, 'per_page=1000');
        });
    }
    // 页面加载时执行
    updatePageLinks();
    // 监听动态加载内容,实时更新链接
    const observer = new MutationObserver(updatePageLinks);
    observer.observe(document.body, { childList: true, subtree: true });
    // 拦截API请求修改参数
    const originalFetch = window.fetch;
    window.fetch = (...args) => {
        if (typeof args[0] === 'string' && args[0].includes('/members')) {
            args[0] = args[0].replace(/per_page=\d+/, 'per_page=1000');
        }
        return originalFetch(...args);
    };
})();

三、数据导出到表格

当页面显示目标结果后,可通过以下方式导出:

  • 控制台代码导出CSV:
    在Console执行代码,提取成员信息并生成CSV文件:
    // 提取页面中成员的名称、主页链接(可根据需求添加其他字段)
    const memberList = Array.from(document.querySelectorAll('.member-item')).map(item => {
      const name = item.querySelector('.member-name').textContent.trim();
      const profileUrl = item.querySelector('a').href;
      return `"${name}","${profileUrl}"`;
    });
    // 生成并下载CSV
    const csvContent = "data:text/csv;charset=utf-8,姓名,主页链接\n" + memberList.join("\n");
    const downloadLink = document.createElement('a');
    downloadLink.href = encodeURI(csvContent);
    downloadLink.download = 'fetlife_western_australia_members.csv';
    document.body.appendChild(downloadLink);
    downloadLink.click();
    document.body.removeChild(downloadLink);
    
  • 浏览器插件导出:
    使用Table Capture等插件,直接识别页面列表并导出为Excel/CSV格式。

注意事项

  • 频繁加载大量数据可能触发网站反爬机制,建议操作间隔不要过短
  • 所有操作需符合Fetlife服务条款,避免账号受限

内容的提问来源于stack exchange,提问作者Katie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.27 13:06:19