前面分析就不多讲了,比较简单,首先下载webpack.js
https://match.yuanrenxue.com/static/match/match16/webpack.js
第一步,首先在最前面添加jsdom的一些通用代码
const jsdom=require("jsdom");const{JSDOM}=jsdom;const dom=new JSDOM("<html><head></head><body><p>hello word</p></body></html>",{url:'https://match.yuanrenxue.com/match/16'});global.window=dom.window;global.document=window.document;
第二步搜索【delete window】,删除掉【delete window,delete document,】
第三步,搜索【btoa,p_s】,修改为【window.btoa,p_s】
并将后面【var i=r;$[e(531)]…】的代码
$[e(531)]({url:window[e(529)],dataType:n[e(492)],async:!1,data:i,type:n.lqSKe,beforeSend:function(e){},success:function(t){var r=e;t=t[r(504)];let i="";$[r(498)](t,(function(e,t){var o=r;i+=n[o(530)](n[o(530)](n[o(515)],t[o(507)]),o(518))})),n[r(508)]($,n[r(514)])[r(521)]("")[r(501)](i)},complete:function(){},error:function(){var t=e;n[t(508)](alert,n[t(524)]),n[t(508)](alert,t(502)),n[t(528)]($,n[t(520)]).eq(0)[t(500)](t(519)),n[t(528)]($,t(511)+"age")[t(523)+"s"](n[t(513)])}})
修改为
console.log('&m='+r.m+'&t='+r.t);process.exit(0);
这时尝试运行代码,正常获取数据