注:该方法已更新,请参照新的文章:
打印CSDN内容,将以下js复制放入 工具—>开发人员工具—>console,回车即可。
(function(){
$("#side").remove();
$("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
$(".nav_top_2011, #header, #navigator").remove();
$(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
$("aside").remove();
$(".tool-box").remove();
$("main").css('display','content');
$("main").css('float','left');
window.print();
$("tool-box").remove();
})();
1、保存为PDF。将打印机改成“另存为PDF”即可。
2、更多设置。可以关闭页眉页脚等。
如图所示:
3、如果还有“点赞”等内容显示,可以先删除对应的<div>元素,然后再进行上面的步骤。
如图所示:
参考链接:https://blog.csdn.net/u010954948/article/details/82843105