browserless docs

browserless docs

  • Quick Start
  • Docker
  • Libraries
  • FAQ
  • Blog
  • Sign-up

›Libraries

Hosted Service

  • Quick Start
  • How it works
  • GraphQL API
  • Best Practices
  • Terminology
  • Using your token

Docker

  • Quick Start
  • Configuration
  • Webhooks
  • Extending

APIs

  • /content
  • /download
  • /function
  • /pdf
  • /screencast
  • /screenshot
  • /scrape
  • /stats
  • /workspace

Libraries

  • Puppeteer
  • Playwright
  • Selenium
  • Capybara
  • .NET
  • Java
  • Python
  • Go (chromedp)

Recipes

  • Dealing with downloads
  • Using a Proxy
  • Watching sessions

Options

  • Launch Options
  • Using API /GET

Go (chromedp)

We're happy to offer beta support of the excellent Go library chromedp!

Usage of the library remains similar to how you'd run your application locally, simply use the RemoteAllocator to connect to browserless API.

An example of navigating to the Example.com site, and getting the title, is listed below as a jumping off point:

package main

import (
  "context"
  "flag"
  "github.com/chromedp/chromedp"
  "log"
)

func main() {
  var devToolWsUrl string
  var title string

  flag.StringVar(&devToolWsUrl, "devtools-ws-url", "wss://chrome.browserless.io", "DevTools Websocket URL")
  flag.Parse()

  actxt, cancelActxt := chromedp.NewRemoteAllocator(context.Background(), devToolWsUrl)
  defer cancelActxt()

  ctxt, cancelCtxt := chromedp.NewContext(actxt) // create new tab
  defer cancelCtxt()                             // close tab afterwards

  if err := chromedp.Run(ctxt,
    chromedp.Navigate("https://example.com"),
    chromedp.Title(&title),
  ); err != nil {
    log.Fatalf("Failed getting body of duckduckgo.com: %v", err)
  }

  log.Println("Got title of:", title)
}

Be sure to let us know if you have questions or issues.

← PythonDealing with downloads →
browserless docs
Docs
Quick StartDocker DocsChrome API
Community
SlackTwitter
More
GitHubStar