There are actually several ways to view the webpage source code. The most common method is to directly select "view webpage source code" in the browser, but sometimes this method cannot work, the following describes several simple methods for your reference!
First: view-source method
View-source is a protocol that is basically supported by every browser in the early stage. But I don't know why. IE no longer supports this protocol since IE6 Beta2. This method can only be used in FireFox now!
Usage: Enter
View-source:
Press enter to view the source code of the webpage.
Method 2: JavaScript
This method does not seem generic either. It was successfully tested on IE6 and Opere browsers, but it was not successful on FireFox!
Usage: Enter
The Code is as follows:
Javascript: s0000document.doc umentElement. outerHTML; document. write (""); Document. body. innerText = s;
Press enter to view the source code of the webpage.
Method 3: Use vbscript
The Code is as follows:
ILocal = "get.htm.txt"
IRemote = inputbox ("Enter the address you want to get the source code", "feet home", "http://www.jb51.net ")
If iRemote = "" then iRemote = "http://www.baidu.com"
Set xPost = createObject ("Microsoft. XMLHTTP ")
XPost. Open "GET", iRemote, 0
XPost. Send ()
Set sGet = createObject ("ADODB. Stream ")
SGet. Mode = 3
SGet. Type = 1
SGet. Open ()
SGet. Write xPost. ResponseBody
SGet. SaveToFile iLocal, 2
Method 4: Use background languages such as asp and php
Some of the methods used are webmaster-level, so you can use the original method to get the code, there are a lot of scripts in the home.