Honestly, if you just need a quick code to check a website python solution, you could even use `httpx`—it's like `requests` but async-friendly.
```python
import httpx
async def check_site():
try:
async with httpx.AsyncClient() as client:
r = await client.get("https://example.com")
print("Up" if r.status_code == 200 else "Down")
except:
print("Failed to connect.")
```
Bonus: it’s faster for multiple sites!
```python
import httpx
async def check_site():
try:
async with httpx.AsyncClient() as client:
r = await client.get("https://example.com")
print("Up" if r.status_code == 200 else "Down")
except:
print("Failed to connect.")
```
Bonus: it’s faster for multiple sites!
