https://github.com/gusanmaz/webshot
WebShot is an easy-to-use CLI for taking screenshots of webpages.
https://github.com/gusanmaz/webshot
cli golang infinite-scroll-webpages screenshot webpage-screenshot
Last synced: 6 months ago
JSON representation
WebShot is an easy-to-use CLI for taking screenshots of webpages.
- Host: GitHub
- URL: https://github.com/gusanmaz/webshot
- Owner: gusanmaz
- License: mit
- Created: 2021-05-06T17:27:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-06T18:06:08.000Z (over 4 years ago)
- Last Synced: 2025-03-26T07:23:13.610Z (6 months ago)
- Topics: cli, golang, infinite-scroll-webpages, screenshot, webpage-screenshot
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## WebShot
WebShot is an easy-to-use CLI for taking screenshots of webpages.
It is based on [Rod](https://github.com/go-rod/rod).## Installation
1. `go get github.com/gusanmaz/webshot`
2. `cd $GOPATH/src/github.com/gusanmaz/webshot`
3. `go install cmd/webshot.go`
## Usage
* ##### Taking full webpage screenshot as an image
`webshot -url https://www.atlasobscura.com -output atlas.png`
* ##### Taking full webpage screenshot with a specific width
`webshot -url https://www.atlasobscura.com -width 800 -output atlas2.png`
* ##### Taking full webpage screenshot as a PDF file
`webshot -url https://www.atlasobscura.com -type pdf -output atlas.pdf`
Unfortunately for now fo most webpages PDF rendering produces mediocre results
* ##### Taking full webpage screenshot as an HTML file
`webshot -url https://www.atlasobscura.com -type html -output atlas.html`
For now this command only outputs HTML content of the given URL. Other resources referenced in the URL such as images are not captured.
* ##### Taking screenshot of an infinite scroll webpage
For infinite scroll webpages you need to specify screenshot height and use infinite flag with true value.
` webshot -url https://www.flickr.com/search/?text=antalya -height 10000 -type image -output antalya.png -infinite true`
You may also modify default values of stepheight and steptime flags. WebShot scrolls infinite page downwards stepheight pixels every steptime milliseconds.
`webshot -infinite true -steptime 300 -stepheight 100 -url https://www.flickr.com/search/?text=winter -height 50000 -type image -output winter.png`
## Author
Güvenç Usanmaz
## License
MIT License