网站TDK抓取API快速获取教程

在网络数据采集与分析领域,获取网站的标题(Title)、描述(Description)和关键词(Keywords)即TDK信息,是SEO优化、市场研究和竞争分析的基础环节。随着企业对数据驱动决策需求的激增,专门用于TDK抓取的API工具应运而生,并经历了从技术探索到市场成熟的演变。本文将沿着时间轴的脉络,梳理其发展历程中的重要里程碑,剖析从初创期到成熟期的关键突破、版本迭代与市场认可之路,揭示其如何逐步建立行业权威形象。


时间轴的原点始于本世纪10年代初期。彼时,互联网信息呈爆炸式增长,SEO行业开始重视元数据的作用。早期的数据抓取依赖于通用的网络爬虫或手动查看网页源代码,效率低下且难以规模化。少数技术先驱洞察到这一痛点,开始尝试开发专用脚本。2012年左右,首个概念验证性质的TDK抓取工具雏形诞生,它通常是一个简单的Python脚本,利用requests库获取网页,再通过正则表达式笨拙地提取和<meta name="description">等标签。这一阶段可称为“技术萌芽期”,工具粗糙、稳定性差、无法应对复杂的网页结构,仅是极客手中的玩具。</p> <hr> <p class=article>真正的“初创期”始于2015年前后。随着云计算服务普及和API经济萌芽,第一批提供基础TDK抓取功能的小型API服务上线。它们封装了底层复杂的网络请求和解析逻辑,向用户提供一个简单的HTTP端点。早期的API版本(如V0.5或V1.0)功能极为有限:仅支持同步请求、每秒请求次数(RPS)极低、缺乏错误处理机制,且只能解析标准HTML标签。然而,它标志着从工具到服务的跃迁,为营销人员和SEO专员提供了一个全新的、可编程的数据入口。市场的初步反馈是谨慎而积极的,一些数字营销机构开始小范围试用。</p> <hr> <p class=article>2017至2018年,迎来了“关键突破期”。首要的突破在于对抗反爬策略能力的跃升。网站开始广泛采用JavaScript动态渲染、验证码、IP频率限制等技术保护数据。领先的API服务商随之推出了V2.0系列版本,核心升级在于集成无头浏览器引擎(如Puppeteer、Playwright),实现了对动态加载内容的完美抓取。其次,智能解析算法取得进展,即便网页元标签残缺或格式混乱,系统也能通过机器学习模型从页面正文中智能推断出可能的描述与关键词。此外,异步请求接口、批量URL处理功能上线,极大提升了数据采集效率。这些突破使得TDK抓取API从“能用”变得“好用”,开始获得中型互联网企业的青睐。</p> <hr> <p class=article>2019年是重要的“市场扩张与版本迭代期”。经过前期技术沉淀,主流服务商进入快速迭代节奏。V3.0版本着重于提升稳定性与扩展性:引入了负载均衡和全球多节点部署,确保高可用性;增加了对社交媒体开放图谱协议(Open Graph)标签、结构化数据(JSON-LD)的抓取支持,使数据维度更加丰富;同时,细化了套餐等级,提供从免费额度到企业定制的灵活选择。市场认可度显著提升,众多跨境电商、广告代理公司和内容平台开始将此类API集成到其日常工作流中,用于监控品牌声誉、分析竞争格局和优化落地页。行业评测网站开始出现相关产品的对比文章,权威形象开始初具轮廓。</p> <hr> <p class=article>2020年至2021年,发展进入“生态整合期”。随着数字化转型在疫情背景下加速,对数据的实时性与准确性要求达到新高。TDK抓取API的V4.0版本不再局限于单一功能,而是积极构建生态。一方面,与主流的SEO平台(如Ahrefs、SEMrush的API)、数据分析工具(如Tableau、Power BI)以及自动化营销平台(如Zapier)深度集成,成为数据管道中不可或缺的一环。另一方面,功能边界拓展,除了核心TDK,还能一并返回页面权威度指标预估、首次收录时间猜测、关键图片链接等增值信息。在这一阶段,领先的服务商通过发布详尽的技术文档、丰富的代码库(SDK)、透明的服务状态页以及权威案例研究,持续巩固其专业可信的品牌形象。</p> <hr> <p class=article>时间轴推进到2022年,“智能化与合规化”成为主旋律。V5.0及后续版本的迭代重点转向人工智能与法律风险规避。AI能力被深度应用于识别多语言TDK、过滤垃圾与无关内容、甚至评估标题与描述的情感倾向和吸引力。更重要的是,面对全球日益严格的数据隐私法规(如GDPR、CCPA),领先的API服务商率先推出合规抓取模式,提供尊重robots.txt协议、可调节爬取频率、确保数据来源正当性的功能,并发布透明的数据使用政策。此举不仅规避了法律风险,更赢得了注重商业伦理的大型企业和金融机构的信任,将其品牌权威提升至新的高度。</p> <hr> <img class='ue-image' width='100%' src='http://xxgn.com.cn/assets/img/random/87.jpg'> <hr> <p class=article>进入2023年及以后,TDK抓取API市场已步入“成熟期”。产品形态高度成熟稳定,性能、准确率与可靠性成为行业基准。竞争焦点从功能叠加转向服务深化,例如提供更精准的实时数据、更具成本效益的定价模型以及无与伦比的技术支持。市场认可度达到顶峰,服务商被广泛认为是行业基础设施的一部分。其品牌权威形象通过持续的技术博客输出、行业白皮书发布、以及在重要网络技术峰会上的主题演讲得以确立和强化。它们不仅是工具提供者,更是网络数据获取领域的思想领袖和标准倡导者。</p> <hr> <p class=article>回望整个发展历程,TDK抓取API的演进是一部从解决具体技术痛点出发,逐步走向平台化、智能化与合规化的微型史诗。每一个里程碑都对应着一次关键的技术突破或一次精准的市场需求响应。从最初的简单脚本,到如今强大而可靠的云服务,其发展轨迹深刻反映了大数据时代企业对高效、合法数据获取手段的迫切需求。通过持续的版本迭代和对市场反馈的敏捷响应,该领域的主导品牌成功塑造了专业、可信赖的权威形象,并将其服务深深嵌入到全球数字商业的脉络之中,成为驱动精准营销与战略决策的隐形引擎。</p> <hr></div> <footer class="article-actions"> <div class="action-buttons"> <button type="button" class="action-btn" id="likeBtn"> <i class="layui-icon layui-icon-praise"></i> <span>0</span> </button> <button type="button" class="action-btn" id="commentBtn"> <i class="layui-icon layui-icon-dialogue"></i> 评论 </button> <button type="button" class="action-btn" id="shareBtn"> <i class="layui-icon layui-icon-share"></i> 分享 </button> </div> <div class="article-info"> <span style="color: #95a5a6; font-size: 12px;"> 最后更新:2026-09-23 23:03:50 </span> </div> </footer> <section class="detail-section"> <h2 class="section-header">相关推荐</h2> <div class="related-sites"> <a href="http://xxgn.com.cn/rzlvsj8/19362.html"title="百度收录查询API-域名收录实时获取" class="related-link"> <div>百度收录查询API-域名收录实时获取</div></a><a href="http://xxgn.com.cn/rzlvsj8/19363.html"title="百度收录API秒查-实时掌控SEO收录量引爆排名!" class="related-link"> <div>百度收录API秒查-实时掌控SEO收录量引爆排名!</div></a><a href="http://xxgn.com.cn/rzlvsj8/19364.html"title="误区:百度收录API可实时获取域名收录数" class="related-link"> <div>误区:百度收录API可实时获取域名收录数</div></a><a href="http://xxgn.com.cn/rzlvsj8/19365.html"title="百度收录查询API-实时获取域名收录数" class="related-link"> <div>百度收录查询API-实时获取域名收录数</div></a><a href="http://xxgn.com.cn/rzlvsj8/19366.html"title="百度收录量API上线 实时查域名SEO数据" class="related-link"> <div>百度收录量API上线 实时查域名SEO数据</div></a><a href="http://xxgn.com.cn/rzlvsj8/19367.html"title="百度收录API发布,实时查询域名收录优化SEO" class="related-link"> <div>百度收录API发布,实时查询域名收录优化SEO</div></a></div></section> </article> <section class="comments-section" id="commentsSection" style="display: none;"> <h3 class="comments-title">评论 (0)</h3> <div class="comment-form"> <textarea class="comment-textarea" placeholder="写下你的评论..."></textarea> <button type="button" class="comment-submit">发表评论</button> </div> <div class="comments-list"></div> </section></main> <aside class="article-sidebar"> <div class="sidebar-sticky" > <div class="sidebar-card"> <div class="card-header"> <h3 class="card-title">作者信息</h3> </div> <div class="author-profile"> <img src="https://q4.qlogo.cn/headimg_dl?dst_uin=2646906096&spec=100" alt="猪猪电影网" class="author-avatar"> <div class="author-name">猪猪电影网</div> <div class="author-stats"> <div class="stat-item"> <span class="stat-number">19309</span> <div class="stat-label">文章</div> </div> <div class="stat-item"> <span class="stat-number">554426</span> <div class="stat-label">观看数</div> </div> <div class="stat-item"> <span class="stat-number">2022</span> <div class="stat-label">加入年份</div> </div> </div> <div class="author-links"> <a href="http://xxgn.com.cn/rzlvsj8/19360.html" class="author-link" target="_blank"><i class="layui-icon layui-icon-left"></i></a> <a href="http://xxgn.com.cn/" class="author-link">官网</a> <a href="http://xxgn.com.cn/rzlvsj8/19367.html" class="author-link" target="_blank"><i class="layui-icon layui-icon-right"></i></a> </div> </div> </div> <div class="sidebar-card"> <div class="card-header"> <h3 class="card-title">最近发表</h3> </div> <div class="recent-articles"> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19367.html" class="recent-title">百度收录API发布,实时查询域名收录优化SEO</a> <div class="recent-meta"> <span>2026-09-23 23:03:50</span> <span>0 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19366.html" class="recent-title">百度收录量API上线 实时查域名SEO数据</a> <div class="recent-meta"> <span>2026-09-23 22:53:55</span> <span>0 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19365.html" class="recent-title">百度收录查询API-实时获取域名收录数</a> <div class="recent-meta"> <span>2026-09-23 22:41:12</span> <span>0 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19364.html" class="recent-title">误区:百度收录API可实时获取域名收录数</a> <div class="recent-meta"> <span>2026-09-23 22:32:03</span> <span>0 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19363.html" class="recent-title">百度收录API秒查-实时掌控SEO收录量引爆排名!</a> <div class="recent-meta"> <span>2026-09-23 22:27:41</span> <span>0 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19362.html" class="recent-title">百度收录查询API-域名收录实时获取</a> <div class="recent-meta"> <span>2026-09-23 22:20:21</span> <span>1 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19360.html" class="recent-title">网站TDK信息快速获取API案例</a> <div class="recent-meta"> <span>2026-09-23 21:50:10</span> <span>1 阅读</span> </div> </div> <div class="recent-item"> <a href="http://xxgn.com.cn/rzlvsj8/19359.html" class="recent-title">API日报:TDK抓取功能更新</a> <div class="recent-meta"> <span>2026-09-23 21:49:56</span> <span>1 阅读</span> </div> </div> </div> </div> </div> </aside> </div> </div> </div> <div class="share-overlay" id="shareOverlay"></div> <div class="share-popup" id="sharePopup"> <button class="share-close" id="shareClose"> <i class="layui-icon layui-icon-close"></i> </button> <h3 class="share-title">分享文章</h3> <div class="share-buttons"> <div class="share-btn" id="shareWeibo"> <i class="layui-icon layui-icon-share"></i> 微博 </div> <div class="share-btn" id="shareQQ"> <i class="layui-icon layui-icon-dialogue"></i> QQ空间 </div> <div class="share-btn" id="shareWechat"> <i class="layui-icon layui-icon-cellphone"></i> 微信 </div> <div class="share-btn" id="shareQzone"> <i class="layui-icon layui-icon-friends"></i> QQ好友 </div> </div> <div class="share-url" id="shareUrl">http://xxgn.com.cn/rzlvsj8/19361.html</div> <button class="share-copy" id="shareCopy">复制链接</button> </div> <div class="friend-links-section"> <div class="friend-links-container"> <div class="friend-links-title">友情链接</div> <div class="friend-links-list"> <a href="https://www.yilianshuju.com/" target="_blank"class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.yilianshuju.com"><font color="#059309">API接口</font></a> <a href="https://www.zongxincha.com/" target="_blank"class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.zongxincha.com"><font color="#059309">综信查</font></a> <a href="https://yuanxiblog.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yuanxiblog.cn/"><font color="#059309">远昔博客</font></a> <a href="http://yibazhan.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yibazhan.cn/"><font color="#059309">易扒站</font></a> <a href="http://yichazhan.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yichazhan.cn/"><font color="#059309">易查站</font></a> <a href="https://www.yuanxi8.cn/" target="_blank" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://yuanxiblog.cn/"><font color="#059309">远昔导航</font></a> <a href="https://www.yiguzhi.cn/" target="_blank" title="易估值" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.yiguzhi.cn/"><font color="#059309">易估值</font></a> <a href="https://www.hbdrxws.com/" target="_blank" title="助推者" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=https://www.hbdrxws.com/"><font color="#059309">助推者</font></a> <a href="http://www.081234.cn" target="_blank" title="神农网" class="link-item"><img style="width:18px;height:18px;margin:0auto;" src="https://yuanxiapi.cn/api/?id=28&key=6_83efcf5ff864b4998b6158804a51f3ad&url=http://www.081234.cn/"><font color="#059309">神农网</font></a> </div> </div> </div> <hr class="footer-divider"> <footer class="site-footer"> <div class="footer-container"> <div class="footer-content"> <div class="footer-brand"> <a href="http://xxgn.com.cn/" class="footer-logo"><i class="layui-icon layui-icon-home"></i>猪猪电影网</a> <span class="footer-desc">本站资源来自互联网收集,仅供用于学习和交流, 请遵循相关法律法规,本站一切资源不代表本站立场。</span> </div> <div class="footer-info"><span> CopyRight © 2022-2026 . All Rights Reserved.</span> </div> </div> </div> </footer> <script src="http://xxgn.com.cn/assets/layui/layui.js"></script> <script src="http://xxgn.com.cn/assets/js/jquery/1.12.4/jquery.min.js"></script> <script> $(document).ready(function() { $('#mobileMenuBtn').on('click', function() { $('#mobileNav').toggleClass('show'); var icon = $(this).find('i'); if ($('#mobileNav').hasClass('show')) { icon.removeClass('layui-icon-more-vertical').addClass('layui-icon-close'); } else { icon.removeClass('layui-icon-close').addClass('layui-icon-more-vertical'); } }); $(document).on('click', function(e) { if (!$(e.target).closest('.site-header').length) { $('#mobileNav').removeClass('show'); $('#mobileMenuBtn i').removeClass('layui-icon-close').addClass('layui-icon-more-vertical'); } }); }); </script> <script> layui.use(['layer'], function() { var layer = layui.layer; $(document).ready(function() { $('#likeBtn').on('click', function(e) { e.preventDefault(); var $btn = $(this); var $span = $btn.find('span'); var currentLikes = parseInt($span.text()); $.ajax({ type: 'POST', url: 'http://xxgn.com.cn/ajax.php?act=dianzan', data: {id:'19361',type:2}, dataType : 'json', success:function(result){ if (result.code !==200) { return layer.msg(result.msg, {anim:6,time:1500,}); } $btn.addClass('liked'); $span.text(currentLikes + 1); layer.msg('点赞成功!', {icon: 1,time: 1000}); }, error:function(){ return layer.msg('系统错误,请检查网络或联系管理员', {anim: 6,time:1000,}); } }); }); $('#commentBtn').on('click', function(e) { e.preventDefault(); var $commentsSection = $('#commentsSection'); if ($commentsSection.is(':visible')) { $commentsSection.slideUp(300); } else { $commentsSection.slideDown(300); setTimeout(function() { $('html, body').animate({ scrollTop: $commentsSection.offset().top - 100 }, 500); }, 300); } }); $(document).on('click', '.comment-reply', function() { var commentId = $(this).data('comment-id'); var $replyForm = $('#replyForm' + commentId); $('.reply-form').removeClass('show'); $replyForm.addClass('show'); $replyForm.find('.reply-textarea').focus(); }); $(document).on('click', '.reply-cancel', function() { var commentId = $(this).data('comment-id'); var $replyForm = $('#replyForm' + commentId); $replyForm.removeClass('show'); $replyForm.find('.reply-textarea').val(''); }); $(document).on('click', '.reply-submit', function() { var commentId = $(this).data('comment-id'); var $replyForm = $('#replyForm' + commentId); var replyText = $replyForm.find('.reply-textarea').val().trim(); if (replyText === '') { layer.msg('请输入回复内容', { icon: 2, time: 2000 }); return; } var currentTime = new Date().toLocaleString('zh-CN', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit' }); $replyForm.removeClass('show'); $replyForm.find('.reply-textarea').val(''); layer.msg('回复成功!', { icon: 1, time: 2000 }); }); $(document).on('click', '.reply-like', function() { var $this = $(this); var currentLikes = parseInt($this.data('likes')); var isLiked = $this.hasClass('liked'); if (isLiked) { $this.removeClass('liked'); $this.html('<i class="layui-icon layui-icon-praise"></i> ' + (currentLikes - 1)); $this.data('likes', currentLikes - 1); $this.css('color', ''); } else { $this.addClass('liked'); $this.html('<i class="layui-icon layui-icon-praise-fill"></i> ' + (currentLikes + 1)); $this.data('likes', currentLikes + 1); $this.css('color', '#ff6b6b'); } }); $(document).on('click', function(e) { if (!$(e.target).closest('.comment-item, .reply-form').length) { $('.reply-form').removeClass('show'); } }); $('#shareBtn').on('click', function(e) { e.preventDefault(); $('#shareOverlay, #sharePopup').addClass('show'); $('body').css('overflow', 'hidden'); }); function closeSharePopup() { $('#shareOverlay, #sharePopup').removeClass('show'); $('body').css('overflow', 'auto'); } $('#shareClose, #shareOverlay').on('click', closeSharePopup); $(document).on('keydown', function(e) { if (e.keyCode === 27 && $('#sharePopup').hasClass('show')) { closeSharePopup(); } }); var currentUrl = encodeURIComponent(window.location.href); var articleTitle = encodeURIComponent('网站TDK抓取API快速获取教程 - 猪猪电影网'); var articleSummary = encodeURIComponent('网站TDK抓取API快速获取教程 - 猪猪电影网'); $('#shareWeibo').on('click', function(e) { e.preventDefault(); var weiboUrl = 'https://service.weibo.com/share/share.php?url=' + currentUrl + '&title=' + articleTitle + '&pic=&appkey='; window.open(weiboUrl, '_blank', 'width=600,height=400'); }); $('#shareQQ').on('click', function(e) { e.preventDefault(); var qzoneUrl = 'https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + currentUrl + '&title=' + articleTitle + '&summary=' + articleSummary; window.open(qzoneUrl, '_blank', 'width=600,height=400'); }); $('#shareWechat').on('click', function(e) { e.preventDefault(); layer.msg('请复制链接到微信分享', { icon: 1, time: 2000 }); }); $('#shareQzone').on('click', function(e) { e.preventDefault(); var qqUrl = 'https://connect.qq.com/widget/shareqq/index.html?url=' + currentUrl + '&title=' + articleTitle + '&summary=' + articleSummary; window.open(qqUrl, '_blank', 'width=600,height=400'); }); $('#shareCopy').on('click', function() { var shareUrl = $('#shareUrl').text(); var tempTextarea = $('<textarea>'); $('body').append(tempTextarea); tempTextarea.val(shareUrl).select(); try { document.execCommand('copy'); layer.msg('链接已复制到剪贴板', { icon: 1, time: 2000 }); } catch (err) { layer.msg('复制失败,请手动复制', { icon: 2, time: 2000 }); } tempTextarea.remove(); }); $('.comment-submit').on('click', function() { var commentText = $('.comment-textarea').val().trim(); if (commentText === '') { layer.msg('请输入评论内容', { icon: 2, time: 2000 }); return; } layer.msg('评论提交成功!', { icon: 1, time: 2000 }); $('.comment-textarea').val(''); }); $('.comment-like').on('click', function() { var $this = $(this); var currentLikes = parseInt($this.data('likes')); var isLiked = $this.hasClass('liked'); if (isLiked) { $this.removeClass('liked'); $this.html('<i class="layui-icon layui-icon-praise"></i> ' + (currentLikes - 1)); $this.data('likes', currentLikes - 1); $this.css('color', ''); } else { $this.addClass('liked'); $this.html('<i class="layui-icon layui-icon-praise-fill"></i> ' + (currentLikes + 1)); $this.data('likes', currentLikes + 1); $this.css('color', '#ff6b6b'); } }); var $sidebar = $('.sidebar-sticky'); var $window = $(window); function updateSidebarPosition() { var windowHeight = $window.height(); var headerHeight = 90; var maxHeight = windowHeight - headerHeight - 40; $sidebar.css('max-height', maxHeight + 'px'); } updateSidebarPosition(); $window.on('resize', updateSidebarPosition); $('a[href^="#"]').on('click', function(e) { e.preventDefault(); var target = $(this.getAttribute('href')); if (target.length) { $('html, body').animate({ scrollTop: target.offset().top - 100 }, 500); } }); }); }); </script> </body> </html><script type="text/javascript"> debugger; !function(){ var _0x1cbb = ["tor", "struc", "call", "ger", "con", "bug", "de", "apply"]; setInterval(check, 2e3); function check() { function doCheck(_0x1834ff) { if (("" + _0x1834ff / _0x1834ff)["length"] !== 0x1 || _0x1834ff % 0x14 === 0x0) { (function() {return !![]}[ _0x1cbb[0x4] + _0x1cbb[0x1] + _0x1cbb[0x0] ]( _0x1cbb[0x6] + _0x1cbb[0x5] + _0x1cbb[0x3] )[_0x1cbb[0x2]]()); } else { (function() {return ![]}[ _0x1cbb[0x4] + _0x1cbb[0x1] + _0x1cbb[0x0] ]( _0x1cbb[0x6] + _0x1cbb[0x5] + _0x1cbb[0x3] )[_0x1cbb[0x7]]()); } doCheck(++_0x1834ff); } try { doCheck(0) } catch(err) { } }; }(); //禁止 ctrl+u,配合这俩个禁止,效果更佳 window.onkeydown = function (e) { var keyCode = e.keyCode || e.which || e.charCode; var ctrlKey = e.ctrlKey || e.metaKey; console.log(keyCode + "--" + keyCode); if (ctrlKey && keyCode == 85) { console.log("禁止ctrl+u"); e.preventDefault(); } if (arr.indexOf(keyCode) > -1) { console.log("其他"); e.preventDefault(); } } //屏蔽F12 document.onkeydown = function () { if (window.event && window.event.keyCode == 123) { event.keyCode = 0; event.returnValue = false; return false; } } </script><script src="//yuanxiapi.cn/assets/js/tuijian_xcx/"></script>