当我以不同的方式查看时,为什么源代码不同?

Joh*_*hen 0 html web

我想读一个网站的源代码,例如.当我使用浏览器的开发者工具时,html标签就像

<html lang="en-CA" class="js flexbox canvas canvastext webgl touch geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths wf-leaguegothic1leaguegothic2-n4-active wf-lemondecourrier1lemondecourrier2-n4-active wf-lemondecourrier1lemondecourrier2-i4-active wf-lemondecourrier1lemondecourrier2-n7-active wf-lemondecourrier1lemondecourrier2-i7-active wf-active">
Run Code Online (Sandbox Code Playgroud)

但是,当我使用view-source:browsehappy.com时,事实证明是这样的

<html lang="en-CA" class="no-js">
Run Code Online (Sandbox Code Playgroud)

那么,当我需要查看当前页面的源代码时,为什么要使用差异和哪种方式呢?

Que*_*tin 5

开发人员工具不会向您显示源.在浏览器解析HTML并使用JavaScript进行操作后,它们会向您显示DOM的表示形式.

您应该使用哪种方法取决于您要查找的信息.