Giter VIP home page Giter VIP logo

webshot's Introduction

WebShot

WebShot is an easy-to-use CLI for taking screenshots of webpages. It is based on 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

webshot's People

Contributors

gusanmaz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.