Back to Browsershot

Getting failed requests

docs/miscellaneous-options/getting-failed-requests.md

5.3.0462 B
Original Source

To get all failed requests encountered while loading a page call failedRequests.

php
$consoleMessages = Browsershot::url('https://example.com')->failedRequests(); // returns an array

The failedRequests method return an array of which each item is yet another array with these keys. Image that a page contains a broken image

  • status: the status code, for a broken image: 404
  • url: the url of the broken image: https://example.com/image.jpg