web2image

command module
v0.0.0-...-c517f76 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

web2image

MIT License GoDoc Go Report Card travis Status

TOC

web2image - Web to image

The web2image will take a screenshot of a given web page.

Usage

$ web2image
Web to image
built on 2017-07-23

Tool to take screenshot from a web page

Usage:
  web2image OPTIONS... URL IMAGE-FILE

Options:

  -h, --help         display help information
  -d, --headless     use chrome-headless docker as client instead of chrome
  -c, --css         *the CSS selector for the region to take the screenshot of
  -s, --sleep[=3s]   time to sleep before waiting for above CSS (default: 3 seconds)
  -w, --wait-for     the CSS selector to wait for before taking the screenshot
  -v, --verbose      verbose mode (multiple -v options increase the verbosity.)
chrome-headless

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.

Examples

Film info from cmore.se

web2image -d -c '#main-wrapper' 'http://www.cmore.se/film/3643033-deadpool' example-deadpool.png

and the result is:

deadpool

US market indexes chart

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:

US-market-indexes

Download binaries

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.

Installation

To install the source code instead:

go get github.com/suntong/web2image

Author

Tong SUN
suntong from cpan.org

All patches welcome.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址