Javascript beautifulsoup-如何删除爬网数据中的js代码?
我使用find_all,但我的数据存在一些问题。 我只需要文本,但js脚本也被复制了 爬网的js数据是这样的。 我怎样才能删除这个Javascript beautifulsoup-如何删除爬网数据中的js代码?,javascript,python-3.x,beautifulsoup,Javascript,Python 3.x,Beautifulsoup,我使用find_all,但我的数据存在一些问题。 我只需要文本,但js脚本也被复制了 爬网的js数据是这样的。 我怎样才能删除这个 window.__mugFnList__.push(function() { !function($, window) { if (mug.common.isDev()) { console.log("asyncGet funding"); }
window.__mugFnList__.push(function() { !function($, window) { if (mug.common.isDev()) { console.log("asyncGet funding"); } function asyncGet() { $.ajax({ url: "getSe3FundingView.nhn", dataType:"html", data: { authorNo: "11166748", seriesNo: "368342" }, success: function(resultHtml){ if (mug.common.isDev()) { console.log("asyncGet funding success!!"); } $.trim(resultHtml); $("#__tmp_fundingView").replaceWith(resultHtml); $(window).trigger("viewerFundingLoad"); }, error: function(resp) { console.log(resp); } }); } $(window).load(function() { setTimeout(asyncGet, 1); }); }(jQuery, window); });
window.__mugFnList__.push(function() {
!function($, window) {
if (mug.common.isDev()) {
console.log("asyncGet event");
}
function asyncGet() {
$.ajax({
url: "getEventView.nhn",
dataType:"html",
data: {
volumeNo: "13440747",
memberNo: "11166748"
},
success: function(resultHtml){
if (mug.common.isDev()) {
console.log("asyncGet event success!!");
}
$.trim(resultHtml);
$("#__tmp_eventView").replaceWith(resultHtml);
"") {
try {window.__viewer._resizePan();}catch(e){};
}
$(window).trigger("viewerEventLoad");
},
error: function(resp) {
console.log(resp);
}
});
}
$(window).load(function() {
setTimeout(asyncGet, 1);
});
}(jQuery, window);
});
在分析数据之前,您可以删除所有的
标记。@AndrejKesely umm。。。请给出更详细的解释。js代码没有您无法使用BeautifulSoup解析Javascript,BeautifulSoup用于解析HTML/XML文档扫描您是否添加了您开发的代码片段?