Skip to content

chromedp Example Go App Scraping Sneaker Price List in StockX

Notifications You must be signed in to change notification settings

yoheimuta/chromedp-example

Repository files navigation

chromedp-example

CircleCI

Scraping specific sneakers' bid price list in StockX:

Setup

Set the project root path to GOPATH.

mkdir chromedp-example
cd chromedp-example
export GOPATH=$(pwd)
go get -d github.com/yoheimuta/chromedp-example # ignore a `no Go files` error.
cd src/github.com/yoheimuta/chromedp-example

Run your chrome headless-shell.

docker pull chromedp/headless-shell
docker run -d -p 9222:9222 --rm --name headless-shell chromedp/headless-shell

Run

There are 3 main.go which use different logic to demonstrate how to utilize the chromedp.

In fact, each code differs only repository injected in main.go.

# normal implementation.
go run cmd/stockx/main.go

# faster implementation. This uses the cookie to skip the confirmation page.
go run cmd/faststockx/main.go

# parallel support implementation. This is more performant.
## NOTE: This uses a local chrome app.
go run cmd/parallelstockx/main.go

Testing

go test -v -count 1 -timeout 240s -race ./...

About

chromedp Example Go App Scraping Sneaker Price List in StockX

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages