Skip to content

Instantly share code, notes, and snippets.

@c0d3x27
Created November 11, 2020 14:34
Show Gist options
  • Save c0d3x27/f4b8ae1ac9620c1ba20b8d03c0412a78 to your computer and use it in GitHub Desktop.
Save c0d3x27/f4b8ae1ac9620c1ba20b8d03c0412a78 to your computer and use it in GitHub Desktop.
script to check for domain status
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def isdomainlive(domain): httpsUrl = "https://" + domain httpUrl = "http://" + domain urls = []
try: requests.get(httpsUrl + "/robots.txt", timeout = 5, verify = False) urls.append(httpsUrl) except: pass
try: requests.get(httpUrl + "/robots.txt", timeout = 5, verify = False)
urls.append(httpUrl)
except:
pass
if urls:
return urls
else: return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment