Hey! If you’re using `requests` and want to avoid exceptions, you can set `stream=True` and check the status code before reading the content. This way, you don’t waste time downloading the body for a 404.
Example:
```python
import requests
url = "http://example.com/404"
response = requests.get(url, stream=True)
if response.status_code == 404:
print("404, skipping!")
else:
print(response.content)
```
This is a neat trick for python get url ignore 404 scenarios.
Example:
```python
import requests
url = "http://example.com/404"
response = requests.get(url, stream=True)
if response.status_code == 404:
print("404, skipping!")
else:
print(response.content)
```
This is a neat trick for python get url ignore 404 scenarios.
