surf

package module
Version: v0.0.0-...-f66789b Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2015 License: MIT Imports: 3 Imported by: 0

README

Surf

Build Status Documentation MIT License

Surf is a Go (golang) library that implements a virtual browser that you can control pragmatically. Just like a real browser you can open pages, follow links, bookmark pages, submit forms, and many other things.

Installation

Download the library using go.
go get github.com/headzoo/surf

Import the library into your project.
import "github.com/headzoo/surf"

Quick Start
package main

import (
	"github.com/headzoo/surf"
	"fmt"
)

func main() {
	bow := surf.NewBrowser()
	err := bow.Open("http://golang.org")
	if err != nil {
		panic(err)
	}
	
	// Outputs: "The Go Programming Language"
	fmt.Println(bow.Title())
}
Documentation

Complete documentation is available on Read the Docs.

Credits

Go was started by Sean Hickey (headzoo) to learn more about the Go programming language. The idea to create Surf was born in this Reddit thread.

Surf uses the awesome goquery by Martin Angers, and was written using Intellij and the golang plugin.

Contributing authors:

Twitter

Contributing

Issues and pull requests are always welcome. Code changes are made to the dev branch. Once a milestone has been reached the branch will be merged in with master, and a new version tag created. Do not make your changes against the master branch, or they will may be ignored.

See CONTRIBUTING.md for more information.

License

Surf is released open source software released under The MIT License (MIT). See LICENSE.md for more information.

Documentation

Overview

Package surf ensembles other packages into a usable browser.

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultUserAgent is the global user agent value.
	DefaultUserAgent = agent.Create()

	// DefaultSendReferer is the global value for the AttributeSendReferer attribute.
	DefaultSendReferer = true

	// DefaultMetaRefreshHandling is the global value for the AttributeHandleRefresh attribute.
	DefaultMetaRefreshHandling = true

	// DefaultFollowRedirects is the global value for the AttributeFollowRedirects attribute.
	DefaultFollowRedirects = true
)

Functions

func NewBrowser

func NewBrowser() *browser.Browser

NewBrowser creates and returns a *browser.Browser type.

Types

This section is empty.

Source Files

Directories

Path Synopsis
Package agent generates user agents strings for well known browsers and for custom browsers.
Package agent generates user agents strings for well known browsers and for custom browsers.
Package browser contains the primary browser implementation.
Package browser contains the primary browser implementation.
Package errors contains error types specific to the Surf library.
Package errors contains error types specific to the Surf library.
Package jar has containers for storing data, such as bookmarks and cookies.
Package jar has containers for storing data, such as bookmarks and cookies.
Package util contains some utility methods used by other packages.
Package util contains some utility methods used by other packages.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL