First of all, the 200 status code is the network connection status, so you only judge 200 and it does not satisfy all websites.
Secondly, when writing a crawler, you should actually see what the rules of these websites are. You can make a manual judgment first and look for the rules. For example, see if the content returned by the web page has any characteristics.
Even if the page status code is 200, the returned 404 page should have different html elements from the normal crawlable page html. You can also judge whether it is a 404 page based on whether there are specific html elements
First of all, the 200 status code is the network connection status, so you only judge 200 and it does not satisfy all websites.
Secondly, when writing a crawler, you should actually see what the rules of these websites are. You can make a manual judgment first and look for the rules. For example, see if the content returned by the web page has any characteristics.
Make a judgment on the content of the web page. If there is no content in the web page, return it directly.
Even if the page status code is 200, the returned 404 page should have different html elements from the normal crawlable page html. You can also judge whether it is a 404 page based on whether there are specific html elements