Giter Site home page Giter Site logo

webdriver's Introduction

This project is not maintained and it is effectively abandoned, if you have interest in this code you should probably clone it.

webdriver

The package implements a WebDriver that communicate with a browser using the JSON Wire Protocol (See https://code.google.com/p/selenium/wiki/JsonWireProtocol). This is a pure go library and doesn't require a running Selenium driver. It currently supports Firefox (using the WebDriver extension) and Chrome (using the standalone server chromedriver). It should be fairly easy to add other browser that directly implement the wire protocol.

Version: 0.1
Tests are partial and have been run only on Linux (with firefox webdriver 2.32.0 and chromedriver 2.1).

Install:
$ go get github.com/fedesog/webdriver

Requires:

Example:

chromeDriver := webdriver.NewChromeDriver("/path/to/chromedriver")
err := chromeDriver.Start()
if err != nil {
	log.Println(err)
}
desired := webdriver.Capabilities{"Platform": "Linux"}
required := webdriver.Capabilities{}
session, err := chromeDriver.NewSession(desired, required)
if err != nil {
	log.Println(err)
}
err = session.Url("http://golang.org")
if err != nil {
	log.Println(err)
}
time.Sleep(10 * time.Second)
session.Delete()
chromeDriver.Stop()

webdriver's People

Contributors

fedesog avatar wirepair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webdriver's Issues

Checking proper install

Hi, chromedriver noob here, tried to follow best practice & installed the chromedriver binary to /usr/bin/ & then use /usr/bin/chromedriver to create the new chromedriver instance within the go script. Getting this message returned, which I am having a difficult time figuring out: chromedriver start failed: fork/exec /usr/bin/chromedriver: permission denied - any suggestions? Thanks fedesog

Firefox.xpi

How do I extract the firefox.xpi out of the selenium-server-standalone.jar file in order to use the FireFox driver? Also, what is the significance of the first argument of the NewFireFoxDriver() function?

headless options

hi, sorry i am new to golang, can someone teach me how i can enable --headless here?

Can't set cookies

Getting the following error from webdriver.Session.SetCookie() unknown error: name of cookie is missing or invalid:"undefined"

Using the following code:

for _, cookie := range session.Web.Jar.Cookies(url) {
            log.Print(cookie.Name)
            log.Print(webSession.SetCookie(webdriver.Cookie{
                Name:cookie.Name,
                Value:cookie.Value,
                Path:cookie.Path,
                Domain:cookie.Domain,
                Secure:cookie.Secure,
                Expiry:int(cookie.Expires.Unix()),
            }))
        }

Logging from cookie gives valid data. Going to have to use selenium for now :/.

Have the ability to set the URL of the webdriver

Within my setup I have an existing chromedriver instance running as a daemon. So i would like to just be able to specify my own url to be used rather then having to call chromedriver.Start() and .Stop()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.