新浪微博内容批量提取

批量提取新浪微博内容

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         新浪微博内容批量提取
// @namespace    80f8bbae-1e20-4b0e-96a1-db12071b6264
// @version      1.0
// @description  批量提取新浪微博内容
// @author       shenglin-feng
// @match        https://weibo.com/*
// @require      https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.slim.min.js
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    $("body").append("<button id='btn' style='position:fixed;left:5px;top:200px;z-index:999999'>提取</button>");

    $("#btn").click(function() {
		var str = "";
		$(".WB_detail").each(function() {
			str += $(this).find(".WB_from .S_txt2:first").text().trim() + "<br>";
            str += $(this).find(".WB_text").text().trim() + "<br>";
		});
        window.open().document.write(str);
    });

})();