May 2018
Beginner
230 pages
4h 49m
English
By viewing the header of the web pages, you can get the same output. Sometimes, the server error output can be changed by programming. However, checking the header might provide lots of information. A very small code can give you some very detailed information, as follows:
import urllib
url1 = raw_input("Enter the URL ")
http_r = urllib.urlopen(url1)
if http_r.code == 200:
print http_r.headers
The print http_r.headers statement provides the header of the web server.
The output is as follows:

You will notice that we have taken two outputs from the program. In the first output, we entered ...
Read now
Unlock full access