import requests
# Function to check if a URL is working
def check_url_status(url):
try:
response = [Link](url, timeout=10)
if response.status_code == 200:
return f"URL {url} is working (Status: {response.status_code})"
else:
return f"URL {url} is not working (Status:
{response.status_code})"
except [Link] as e:
return f"URL {url} failed with exception: {e}"
# List of URLs to test
urls = [
"[Link]
"[Link]
"[Link]
# Loop through URLs and check their status
for url in urls:
print(check_url_status(url))
# Read URLs from a file
with open('[Link]', 'r') as file:
urls = [Link]()
# Check each URL from the file
for url in urls:
url = [Link]() # Remove any whitespace/newline characters
print(check_url_status(url))