pwshub.com

Capture Websites with a Click: Command Line Screenshot Magic

Capture Websites with a Click: Command Line Screenshot Magic
Capture Websites with a Click: Command Line Screenshot Magic

How to Capture a Website's Screenshot Using Command Line

To take a screenshot using the command line on a Mac:

  • Open the Terminal app.
  • Adjust the following command:
    • Specify the screenshot's saved location and filename.
    • Enter the URL of the website you want to capture.
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --headless \
  --screenshot=</path/to/screenshot/image.png> \
  <https://www.domain.com>
  • Example:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --headless \
  --screenshot=</screenshots/apple.png> \
  <https://www.apple.com>
  • Customize the screenshot's dimensions by adding:
--window-size=WIDTH,HEIGHT
  • Example:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
  --headless \
  --window-size=450,800 \
  --screenshot=/screenshots/apple.png \
  https://apple.com

newsid: 1nszlojtdtsuhl1

Related stories
1 hour ago - Terminal aliases allow you to create shortcuts for repetitive commands, saving time and effort by assigning shorter labels to longer commands.
2 days ago - FFmpeg 7.0 introduces parallel processing, MPEG-5 EVC support, and improved media container handling.
3 days ago - When buying a gaming keyboard, consider performance, personal preference, switch type, latency, comfort, and extra features.
3 days ago - Manually deploy a React and TypeScript project on Netlify by building it, dragging and dropping the dist folder, and renaming the site.
4 days ago - Ubuntu 24.04 Beta is available for download, offering improved visuals, accessibility features, and GNOME 46 updates, allowing users to test and provide feedback before the final release.
Other stories
1 hour ago - "Shift left" in software development involves identifying and addressing problems early in the project lifecycle to minimize time and effort spent on fixing issues later.
1 hour ago - GitHub Wikis provide easy documentation for repositories, allowing collaboration and Markdown-based editing.
2 hours ago - To make Facebook private, adjust privacy settings for profile information, posts, search visibility, and message requests.
4 hours ago - Apple allowed emulators in the App Store but removed iGBA due to spam and copyright concerns, despite initially announcing their permission.
5 hours ago - Burned CDs can last 5-10 years, but data protection measures like copying and proper storage can extend their lifespan.