Questions tagged [chromedp]

A Go language package that implements a client for CDP (Chrome DevTools Protocol).

chromedp package is a high level CDP (Chrome DevTools Protocol) client in language that simplifies driving browsers for scraping, unit testing, or profiling web pages using the CDP.

chromedp requires no third-party dependencies, implementing the async Chrome DevTools Protocol entirely in Go.

65 questions
0
votes
1 answer

How to run different codes according to login status in chromedp?

demo codes: package main import ( "context" "log" "time" "github.com/chromedp/cdproto/cdp" "github.com/chromedp/cdproto/target" "github.com/chromedp/chromedp" "github.com/chromedp/chromedp/kb" ) func getTargetId(ctx…
0
votes
1 answer

How to log into YouTube (Google) with ChromeDP/Go?

I'm trying to log into Youtube, which redirects to accounts.google.com/ServiceLogin?service=youtube... with chromedp. For some reason it times out trying to retrieve anything from that page. Most of the selectors have randomly generated classes but…
vinniyo
  • 145
  • 14
0
votes
1 answer

How to navigate Chrome settings using `chromedp`?

I'm trying to navigate the Chrome settings page using chromedp in go. The full example is here, but the gist is something very basic and simple: //... if err := cdp.Run(ctx, cdp.Navigate(`chrome://settings/content/location`), …
filmil
  • 119
  • 7
0
votes
1 answer

How to access db while running a webdriver using chromedp?

I want to automate OTP submission on a bank page. I will get the OTP in my database only after webdriver have clicked confirm on the bank page. After confirming, I need to fetch OTP from the db and then automate OTP submission. ctx, cancel :=…
0
votes
1 answer

Tasks inside chromedp.ActionFunc not working as expected

This is my code: package main import ( "context" "log" "fmt" "github.com/chromedp/chromedp" ) func main() { queries := [3]string{"Object.keys(window);", "window.CSS", "window.Array"} // create…
Raywando
  • 129
  • 5
0
votes
0 answers

Type in chromedp with the keycode from client

I have a piece of code in javascript that sends a request to the server with a list of my keypresses. The way I get the keycodes is like this: window.onkeypress = function (event) { keypresses.push(event.which); } On my golang code, I'm…
Eric.M
  • 827
  • 1
  • 14
  • 29
0
votes
0 answers

Could not find node with given id (-32000) when using chromedp

i'm trying to scrape a website with chromedp, at some point there is multiple pages and I need to click on each of them. I successfully click on page 2 (each page is a element) and scrape it's content but when my code need to click the page…
Romain P
  • 55
  • 1
  • 1
  • 11
0
votes
1 answer

What is a valid html for WithFooterTemplate method of PrintToPDF function in chromedp?

We have tried to add page numbers to our printed html page. But we didn't succeed. Right now the code looks like this. chromedp.ActionFunc(func(ctx context.Context) error { var err error buf, _, err = page.PrintToPDF(). …
0
votes
1 answer

chromedp fails to start a new instance of chrome

Hey guys I have been trying to automate a task on my browser's machine using chromedp. I tried examples on the repo however they always fail: unexpected fault address 0x7f7a36461000 fatal error: fault [signal SIGBUS: bus error code=0x2…
Oussama Ben Ghorbel
  • 2,132
  • 4
  • 17
  • 34
0
votes
1 answer

network usage on chromedp

I am trying to find response size for every request from chromedp I tried following code chromedp.ListenTarget( ctx, func(ev interface{}){ if ev, ok := ev.(*network.EventResponseReceived); ok { fmt.Println("event…
Vishnu V
  • 382
  • 5
  • 16
0
votes
0 answers

How to verify that chrome is working on my Amazon Linux AMI server?

On my server I am using Chromedp (a Go package) that runs a headless version of chrome to generate PDFs for me. When I run this process on my windows machine it works great. Then when I try to run it on my Amazon Linux AMI server I always get the…
0
votes
1 answer

Authenticate proxy server (ccproxy) in headless chrome

I'm using golang chromedp as headless webdriver and ccproxy as proxy server, according to this document i'm set credentials headers but chrome also show basic authentication popup. chromeDP (set headers): func (c *Browser) setHeaders()…
Ata amini
  • 39
  • 1
  • 8
0
votes
1 answer

Load up existing Chrome user profile & data with chromedp

When I load up a chromedp context I want it to use my default Chrome session. Keeping all session data and things. So when I load up Dropbox, Discord, Twitter, YouTube... etc I should already logged in and can readily interact with them through…
Ben
  • 3,160
  • 3
  • 17
  • 34
0
votes
0 answers

Download the streaming m3u8 video from Chrome

Im trying to download video from the below html code. Please note Im going to run this inside Golang chromedp code. Which can be found at…
STEEL
  • 8,955
  • 9
  • 67
  • 89
0
votes
2 answers

Suppress the error messages generated from the package

I am using a Go function which roughly works as follows: It traverses the given URL and searches for a string For traversing the websites I have used Chrome DevTools package. My problem is while it's doing the traversal, it logs some error…
Benk I
  • 185
  • 13