Skip to content

Your friendly friend in modern web automation and testing.

License

Notifications You must be signed in to change notification settings

ghetzel/go-webfriend

Repository files navigation

   “Your friendly friend in modern web automation and testing.”

ALPHA ALERT

This software is under heavy development and should not be considered production-ready. Much of it works, but much is still yet to be implemented. It is a ground-up rewrite of my Python version of this project. Documentation and examples are missing and incomplete at this time, but I am working on it as I am able.

I welcome polite feedback, comments, and suggestions.

Overview

Webfriend is a Golang library and command-line utility that integrates with the Chrome DevTools Protocol to control a Google Chrome or Chromium browser instance. There is also a purpose-built scripting language (called Friendscript) that is designed to be an easy-to-learn environment for writing simple or complex browser automation scripts.

Some of the things that you can use Webfriend for:

  • Take full-page screenshots of web pages.

  • Automate tedious or repetitive tasks on web pages that otherwise would require extensive user input with a keyboard, mouse, or touchscreen device.

  • Execute pre-defined tests against web pages and serve as an automated testing framework for verifying frontend functionality.

  • Automatically login to websites with complex authentication flows.

  • Extract (i.e. scrape) information from web pages and present it in a structured way that other languages and scripts can use as input.

  • Inject Javascript code into the browser, evaluate it, then return the results for output or further processing.

Operation and Usage

Webfriend by default operates using Headless Chrome mode, but can also just as easily run Chrome in the foreground in a graphical environment. Importantly, headless operation allows you to run Webfriend on servers without running Xfvb or X11. In this sense, it operates as a potentially-faster alternative to phantomjs or Selenium while also providing almost all of the capabilities of the complete Google Chrome/Chromium browser.

Using Friendscript, straightforward and composable scripts can be written and combined together to create fast, modular, and flexible processes that can be used to solve real problems.

Installation

go install github.com/ghetzel/go-webfriend/webfriend

Documentation

About

Your friendly friend in modern web automation and testing.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published