{{render "license/shields" . "License" "MIT"}} {{template "badge/godoc" .}} {{template "badge/goreport" .}} {{template "badge/travis" .}}
The web2image
will take a screenshot of a given web page.
The following examples assumes that you've setup chrome-headless already. Else, take a look at Chrome DevTools Protocol on how to start a local chrome with the remote-debugging-port opening at 9222
.
web2image -d -c '#main-wrapper' 'http://www.cmore.se/film/3643033-deadpool' example-deadpool.png
and the result is:
web2image -d -s '5s' -c 'div > section.market-indexes-component > div.market-indexes-container' http://www.morningstar.com/ example-US-market-indexes.png
and the result is:
The latest binary executables are available under
https://bintray.com/suntong/bin/web2image#files/web2image
as the result of the Continuous-Integration process.
I.e., they are built right from the source code during every git commit automatically by travis-ci.
Pick & choose the binary executable that suits your OS and its architecture. E.g., for Linux, it would most probably be the -linux-amd64
file. If your OS and its architecture is not available in the download list, please let me know and I'll add it.
To install the source code instead:
go get github.com/suntong/web2image
All patches welcome.