How to use Python to get URL and ignore 404 errors?

18 Replies, 1046 Views

Hey everyone,

So I’m trying to figure out how to use python get url ignore 404 errors. Like, I’m scraping some pages, and some links just don’t exist, ya know? I don’t want my script to crash every time it hits a 404.

I’ve tried using `requests.get()` but it throws an exception when it hits a 404. Is there a way to just skip those and keep going? Maybe something like a try-except block? Or is there a cleaner way?

Also, if anyone has a snippet or example for python get url ignore 404, that’d be super helpful.

Thanks in advance! 🙏

(btw, sorry if this has been asked before, I did a quick search but couldn’t find exactly what I needed.)

Messages In This Thread
How to use Python to get URL and ignore 404 errors? - by - 09-01-2025, 08:39 PM



Users browsing this thread: 1 Guest(s)