Created
November 11, 2020 14:34
-
-
Save c0d3x27/f4b8ae1ac9620c1ba20b8d03c0412a78 to your computer and use it in GitHub Desktop.
script to check for domain status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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