Skip to content

Instantly share code, notes, and snippets.

@badbye
Created February 8, 2022 04:39
Show Gist options
  • Save badbye/1e85d483d04c12f71503e607b0bbcda1 to your computer and use it in GitHub Desktop.
Save badbye/1e85d483d04c12f71503e607b0bbcda1 to your computer and use it in GitHub Desktop.
免费下载道客巴巴的文档. download file from doc88.com without paying
$('#continueButton').click()
var keeps = $("#pageContainer").parentsUntil('body').toArray().concat($("#pageContainer").children().toArray())
var divs = $("div:not(#pageContainer)").toArray()
divs.filter(x => keeps.indexOf(x) < 0).forEach(x => x.remove())
window.print()
@badbye
Copy link
Author

badbye commented Feb 8, 2022

在控制台执行以上代码即可。

另一种方式,适合不会打开页面控制台的人。在浏览器地址栏,粘贴以下代码,回车即可。

javascript:$('#continueButton').click();var keeps = $("#pageContainer").parentsUntil('body').toArray().concat($("#pageContainer").children().toArray());var divs = $("div:not(#pageContainer)").toArray();divs.filter(x => keeps.indexOf(x) < 0).forEach(x => x.remove());window.print()

大部分浏览器会自动把“javascript:”这个前缀吃掉,粘贴后可能需要手动输入这个前缀。

@NoBin193746
Copy link

@NoBin193746
Copy link

@NoBin193746
Copy link

javascript:$('#continueButton').click();var keeps = $("#pageContainer").parentsUntil('body').toArray().concat($("#pageContainer").children().toArray());var divs = $("div:not(#pageContainer)").toArray();divs.filter(x => keeps.indexOf(x) < 0).forEach(x => x.remove());window.print()

@NoBin193746
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment