SPATIE

  • Products
  • Open Source
  • Courses
  • Web Development
VacanciesAboutBlogDocsGuidelinesMerch ↗ Log in

Docs Browsershot Miscellaneous-options Prevent unsuccessful responses

Other versions for crawler v4 v3
    • Introduction
    • Support us
    • Requirements
    • Installation & setup
    • Upgrading
    • Questions and issues
    • Changelog
    • About us

    Usage

    • Introduction
    • Creating images
    • Creating PDFs
    • Creating HTML

    Miscellaneous options

    • Adding extra headers to every request
    • Adding extra headers to the navigational request
    • Changing the language of the browser
    • Changing the value of a dropdown
    • Clicking on the page
    • Connection to a remote chromium/chrome instance
    • Disable sandboxing
    • Fixing cors issues
    • Getting console output
    • Getting failed requests
    • Ignore HTTPS errors
    • Passing environment variables to the browser
    • Performance
    • Prevent unsuccessful responses
    • Sending POST requests
    • Setting an arbitrary option
    • Setting the CSS media type of the page
    • Setting the timeout
    • Setting the user agent
    • Specifying-a-proxy-server
    • Typing on the page
    • Using a pipe instead of a WebSocket
    • Using cookies
    • Using HTTP Authentication
    • Using url for html content
    • Writing options to a file
    • Disabling redirects
    • Read redirect history

Prevent unsuccessful responses

You may want to throw an error when the page response is unsuccessful, you can use the following method :

Browsershot::url('https://example.com')
   ->preventUnsuccessfulResponse()
    ...
Performance
Sending POST requests
Help us improve this page
Laravel beyond CRUD

Check out our course on Laravel development for large apps

Help us improve this page
  • Products
  • Open Source
  • Courses
  • Web Development
VacanciesAboutBlogDocsGuidelinesMerch ↗ Log in

Kruikstraat 22, Box 12
2018 Antwerp, Belgium
info@spatie.be
+32 3 292 56 79
  • GitHub
  • Instagram
  • LinkedIn
  • Twitter
  • Bluesky
  • Mastodon
  • YouTube
  • Privacy
  • Disclaimer

+32 3 292 56 79

Our office is closed now, email us instead

    Enter a search term to find results in the documentation.