Check for 404 errors in bulk using this simple Python script and a list of URLs

import requests
def get_url_status(urls): # checks status for each url in list urls

for url in urls:
try:
r = requests.get(url)
print(url + "\tStatus: " + str(r.status_code))
except Exception as e:
print(url + "\tNA FAILED TO CONNECT\t" + str(e))
return None
def main():

urls = ["https://www.foundryoutdoors.com"]
get_url_status(urls)
if __name__ == "__main__":
main()
pip install requests

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store