GithubHelp home page GithubHelp logo

pavel-r / chromedp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chromedp/chromedp

0.0 0.0 0.0 2.07 MB

A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.

License: MIT License

Go 100.00%

chromedp's Introduction

About chromedp GoDoc Build Status

Package chromedp is a faster, simpler way to drive browsers supporting the Chrome DevTools Protocol in Go using the without external dependencies (like Selenium or PhantomJS).

Installing

Install in the usual Go way:

go get -u github.com/chromedp/chromedp

Examples

Refer to the GoDoc page for the documentation and examples. The examples repository contains more complex scenarios.

Frequently Asked Questions

I can't see any Chrome browser window

By default, it's run in headless mode. See DefaultExecAllocatorOptions, and an example to override said options.

I'm seeing "context canceled" errors

If the connection to the browser is dropped, the context will be cancelled, which can be an unexpected reason for this error. For example, if the browser is closed manually.

Chrome exits as soon as my Go program finishes

This is set up on Linux to avoid leaking resources. If you want Chrome to be a long-running process, start it separately and connect to it via RemoteAllocator.

Execute an action results in "invalid context"

By default, a chromedp context doesn't have an executor set up. You can specify one; see #326.

I can't use an Action with Run because it returns many values

Wrap it with an ActionFunc:

chromedp.Run(ctx, chromedp.ActionFunc(func(ctx context.Context) error {
	_, err := domain.SomeAction().Do(ctx)
	return err
}))

Resources

chromedp's People

Contributors

bpot avatar jalfresi avatar kotamat avatar ljun20160606 avatar mvdan avatar pmurley avatar rnd avatar tebeka avatar

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.