SPATIE

Services
Our philosophy Packages Postcards Guidelines Documentation
Products Blog About
Login Work with us

Docs Browsershot Miscellaneous-options Setting the user agent

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

Setting the user agent

If you want to set the user agent Google Chrome should use when taking the screenshot you can do so:

Browsershot::url('https://example.com')
    ->userAgent('My Special Snowflake Browser 1.0')
    ->save($pathToImage);
Setting the timeout
Specifying-a-proxy-server
Help us improve this page
Laravel beyond CRUD

Check out our course on Laravel development for large apps

Help us improve this page
  • Services
  • Open source
  • Products
  • Courses
AboutBlogNewsletterDocsGuidelines

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

+32 3 292 56 79

Click to call us

A good
match?

What we do best

  • All things Laravel
  • Custom frontend components
  • Building APIs
  • AI-powered features
  • Simplifying things
  • Clean solutions
  • Integrating services

Not our cup of tea

  • WordPress themes
  • Cutting corners
  • Free mockups to win a job
  • "Just execute the briefing"

In short: we'd like to be a substantial part of your project.

Get in touch via email

    Enter a search term to find results in the documentation.