Tools to Capture and Convert the Web
GrabzIt's Online Community

How to capture 500 and other 5xx server errors with URLToImage?

Ask questions relating to GrabzIt's Web Scraper Tool. Such as how to use the web scraper and API to extract data from web pages, images or PDF documents.

I am using the code simillar to https://grabz.it/api/aspnet/advanced/com-object/. The catch handler does catch the 404 error with this returned message "You are trying to take a screenshot of a URL that does not exist! Please enter a URL that is both absolute and public, for instance: http://www.example.com". However when there is a server error, the code still goes through and the image captured is of a Server Error web page. Is there a way for URLToImage to also flag those errors?

Asked by GrabzIt Support on the 14th of June 2019

This message "You are trying to take a screenshot of a URL that does not exist! Please enter a URL that is both absolute and public, for instance: http://www.example.com" is not a 404 error. This occurs for invalid URL formats and if the domain does not exist.

As long as those two criteria are met we capture whatever is found.

Answered by GrabzIt Support on the 14th of June 2019