splash

package module
v0.0.0-...-9cc01f6 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2017 License: MIT Imports: 6 Imported by: 0

README

go-splash

a simple wrapper for Splash HTTP API.

Installation

Install Splash
docker pull scrapinghub/splash
Clone the Source
go get github.com/PuerkitoBio/goquery # used in example
go get github.com/nladuo/go-splash

Example

Take screenshot for "https://www.baidu.com/s?wd=github"

1.Start the container
docker run -p 8050:8050 scrapinghub/splash
2.Run the script
cd $GOPATH/src/github.com/nladuo/go-splash/example # enter the directory
go run take_screenshot.go                          # run the script
ll | grep baidu_github.png                         # see the screenshot

take_screenshot

LICENSE

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	Png     bool
	Timeout int
	Wait    float64
}

type Response

type Response struct {
	Title        string
	Url          string
	RequestedUrl string
	Base64Png    string
	Html         string
}

func (*Response) SavedPng

func (this *Response) SavedPng(filename string) error

type SplashClient

type SplashClient struct {
	SplashHost string
	SplashPort string
}

func NewSplashClient

func NewSplashClient(splash_host string, splash_port string) (*SplashClient, error)

func (*SplashClient) Get

func (this *SplashClient) Get(url string, option *Option) (*Response, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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