How do I avoid 404 breaks? I am still using 1.5 - but a test with 1.9 give same error. I use: $html = file_get_html($url);
Error:
Warning: file_get_contents(http://www.apple.com/br/shop/buy-iphone/iphone-12-pro): failed to open stream: HTTP request failed! HTTP/1.0 404 Not Found in .......
The program breaks at that point and I need to remove the URL. After that it works (to the next bad URL). Is there a way to just ignore bad URLs?
Update: I did some recode. Instead of
file_get_html($url)I usedcURLto get the website data, that check for a keyword withstrpos()and then prcessed withstr_get_html($body)Perfect workaround for me.
Last edit: JensHK 2020-10-16
Good to know you found a solution :)