For python get url ignore 404, you can also use the `retry` library to automatically retry failed requests. Sometimes 404s are temporary, so this can help.
Example:
```python
from retry import retry
import requests
@retry(tries=3, delay=2)
def fetch_url(url):
response = requests.get(url)
if response.status_code == 404:
print("404, skipping!")
else:
return response
fetch_url("http://example.com/404")
```
This adds some resilience to your script.
Example:
```python
from retry import retry
import requests
@retry(tries=3, delay=2)
def fetch_url(url):
response = requests.get(url)
if response.status_code == 404:
print("404, skipping!")
else:
return response
fetch_url("http://example.com/404")
```
This adds some resilience to your script.
