Coder Social home page Coder Social logo

examples's Introduction

About chromedp examples

This folder contains a variety of code examples for working with chromedp. Please note that when the chromedp package is being rewritten, these examples may break. Additionally, since these examples are written for specific websites, there is a good chance that the current selectors, etc break after the website they are written against changes.

While every effort is made to ensure that these examples are kept up-to-date, it is expected that the examples made available here and working, As this is not a core part of the chromedp project,

Building and Running an Example

You can build and run these examples in the usual Go way:

# retrieve examples
$ go get -u -d github.com/chromedp/examples

# run example <prog>
$ go run $GOPATH/src/github.com/chromedp/examples/<prog>/main.go

# build example <prog>
$ go build -o <prog> github.com/chromedp/examples/<prog> && ./<prog>

Available Examples

The following examples are currently available:

Example Description
click use a selector to click on an element
cookie set a HTTP cookie on requests
eval evaluate javascript and retrieve the result
headers set a HTTP header on requests
keys send key events to an element
logic more complex logic beyond simple actions
pool use chromedp pool
screenshot take a screenshot of a specific element
simple do a simple google search
standalone use chromedp with a standalone (ie, a "pre-existing" / manually started) chrome instance
submit fill out and submit a form
text extract text from a specific element
upload upload a file on a form
visible wait until an element is visible

Contributing

Pull Requests and contributions to this project are encouraged and greatly welcomed! The chromedp project always needs new examples, and needs talented developers (such as yourself!) to submit fixes for the existing examples when they break (for example, when a website's layout/HTML changes).

examples's People

Watchers

 avatar  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.