Skip to content
/ webrowser Public

a crawler browser contains phantomjs for golang

Notifications You must be signed in to change notification settings

k4s/webrowser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

包含golang原生httpClient引擎,和phantomjs的下载引擎,你可以把它看成一个爬虫浏览器,后期打算添加Selenium It contains golang httpClient engine, and phantomjs download engine, you can use it as a crawler browser ,the next idea to add the Selenium

package main

import (
	"fmt"
	"io/ioutil"
	"net/http"

	. "github.com/k4s/webrowser"
)

func main() {
	p := &Param{
		Method:       "GET",
		Url:          "http://weibo.com/kasli/home?wvr=5",
		Header:       http.Header{"Cookie": []string{"your cookie"}},
		UsePhantomJS: true,
	}
	brower := NewWebrowse()
	resp, err := brower.Download(p)
	if err != nil {
		fmt.Println(err)
	}
	body, err := ioutil.ReadAll(resp.Body)
	fmt.Println(string(body))
	fmt.Println(resp.Cookies())
}

About

a crawler browser contains phantomjs for golang

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages