If you want something lightweight without extra libs, `urllib.request` works too. Not as fancy as `requests`, but gets the job done:
```python
from urllib.request import urlopen
from urllib.error import URLError
try:
with urlopen("https://example.com", timeout=10) as response:
print(f"Status: {response.status}")
except URLError as e:
print(f"Oops, site might be down: {e}")
```
Bonus: no need to install anything!
```python
from urllib.request import urlopen
from urllib.error import URLError
try:
with urlopen("https://example.com", timeout=10) as response:
print(f"Status: {response.status}")
except URLError as e:
print(f"Oops, site might be down: {e}")
```
Bonus: no need to install anything!
