You would like to check the existence of a web page without downloading the HTML content. This means that we need to send a get HEAD request with a browser client. According to Wikipedia, the HEAD request asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.
Checking whether a web page exists with the HEAD request
How to do it...
We would like to send a HEAD request to http://www.python.org. This will not download the content of the home page, rather it checks whether the server returns one of the valid responses, for example, OK, FOUND, MOVED...