https://jugad2.blogspot.com/2018/03/checking-if-web-sites-ar...
A couple of results for Twitter and LinkedIn:
$ python is_site_online.py https://mobile.twitter.com https://linkedin.com
Checking if given sites are online or not:
https://mobile.twitter.com https://linkedin.com
------------------------------------------------------------
Checking https://mobile.twitter.com:
Error: Could not connect.
ConnectionError: ("bad handshake: SysCallError(-1, 'Unexpected EOF')",)
$ python is_site_online.py https://linkedin.com
Checking if given sites are online or not:
------------------------------------------------------------
Checking https://linkedin.com:
Site: https://linkedin.com
Check with allow_redirects = False
Results:
r.ok: True
r.status_code: 301
request time: 5.797 secs
------------------------------------------------------------
Error: Exception: Exceeded 30 redirects.
Interesting thing is that last line above. Did not see it before when using this program.