Hey! For a quick code to check a website python script, I'd go with `requests`. It's super easy to use. Here's a basic snippet:
```python
import requests
try:
response = requests.get("https://example.com", timeout=5)
print("Site is up!" if response.status_code == 200 else "Site is down.")
except:
print("Couldn't connect.")
```
If you wanna run it periodically, just slap it in a loop with `time.sleep(60)` for checks every minute.
```python
import requests
try:
response = requests.get("https://example.com", timeout=5)
print("Site is up!" if response.status_code == 200 else "Site is down.")
except:
print("Couldn't connect.")
```
If you wanna run it periodically, just slap it in a loop with `time.sleep(60)` for checks every minute.
