Go package for capturing screenshots of websites in various resolutions. It uses phantomjs in the background.
First you will need to install phantomjs then you can run go get
go get github.com/frozzare/go-screenshot
package main
import (
"fmt"
"log"
"github.com/frozzare/go-screenshot"
)
func main() {
s := screenshot.NewScreenshot(&screenshot.Options{
URL: "https://google.com",
})
file, err := s.Save() // or s.Save("https://google.com")
if err != nil {
log.Fatal(err)
}
// Path to image.
fmt.Println(file)
}
MIT © Fredrik Forsmo