I am using urllib.request
to download from url's, and handling the 404 error with try
and except
block. But some sites uses a custom 404 page instead of throwing error which urllib.request
thinks for resources found and theexcept
blocks fails to handle the appropriate action. I want to know if there is a way for the request to know, when a resource is not found when running into a custom 404 page?
Edit: to make it a little for clear, the http returns the body of the 404 page with status 200 ok.