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
1
vote
1 answer

How can I modify attributes of an HTML element with chromedp

I'm trying to set the disabled attribute of an input element to false with chromedp. I can modify it's value with the console chrome dev tool but didn't achieved it in my code. I will explain the complete behaviour of this input and why I need…
Romain P
  • 55
  • 1
  • 1
  • 11
1
vote
1 answer

chromedp clear not working with select by query

I am having issues with chromedp.Clear() I am succesfully able to fill the below input with: chromedp.SendKeys(`input[name="TESTFIELD"]`, "new value", chromedp.ByQuery) But clearing it first with: chromedp.Clear(`input[name="TESTFIELD"]`,…
snowbird
  • 93
  • 1
  • 8
1
vote
1 answer

Variables assigned in chromedp.ActionFunc cannot be inputted by SendKeys

I want to assign strings to a variables, after some processes, in chromedp.ActionFunc. Refer to below example. However, chromedp.SendKeys after chromedp.ActionFunc couldn't input the variable to a form. I confirmed the above with…
yuji
  • 13
  • 2
1
vote
0 answers

How suspend chromedp.Submit() so javascript can update action field

I'm attempting to use chromedp to log into a dashboard. the action on the form is action="javascript:void(0);". When submit is pressed a number of JS functions kick off, with the end result producing the url; the action updated and the submit…
Ian
  • 21
  • 1
1
vote
1 answer

How to open tab in new window of the same browser with chromedp?

How to open tab in new window of the same browser? Some web applications do not work in an inactive tab. In the example, several windows open, but only the first window is available for management. When creating the rest, an error occurs chrome…
semen
  • 21
  • 1
  • 4
1
vote
2 answers

Click button with Chromedp

I am trying to use the Go library Chromedp to scrape some data from a web page. I basically need to click on a button, take for example the "Click me" button from the W3C School website. I need to filter that button with the value HTML attribute of…
TPPZ
  • 4,447
  • 10
  • 61
  • 106
0
votes
1 answer

The screenshot generated by `FullScreenshot()` in chromedp package is too blurry, how can I improve it?

As shown in the title, here is the result and my code. By the way, I am using a very low-end machine. func main() { chromeCTX, _ := chromedp.NewContext(context.Background()) emulation.SetDeviceMetricsOverride(1920, 1080, 1.0,…
Rootive
  • 21
  • 3
0
votes
1 answer

Scrolling to bottom of infinite scroll page then getting html document

I'm kinda lost as to how to carry out this task as I'm pretty new to golang. I'm trying to scroll to the bottom of a page that uses infinite scroll in order to load all of the elements and then save the response as an HTML file (or even better just…
ieatglue
  • 25
  • 1
  • 4
0
votes
1 answer

chromedp how to select specific textarea from multiple with dynamic names

I have a page which has multiple textarea's which are made with dynamic names and identical classes. This means I cannot select them by id, name, class or type. What I do know is that out of the 5 textarea's, I need the first one and I want to…
0
votes
1 answer

Chromedp Golang scraper not executing correctly

I have created a Go module that uses chromedp to login and download some reports from my companies CRM system. I pulled this report on to our Ubuntu 20.04 server, created a bash file that enters the directory of the module and call the command: go…
0
votes
1 answer

Chromedp - how to get image file size and real dimensions

I am trying to retrieve some information like page load time, first paint but also the images and scripts that are being loaded and their sizes. I am able to detect everything that is being loaded in terms of images and scripts but when I look at…
0
votes
1 answer

How to disable javascript in chromedp?

I want to disable javascript in https://github.com/chromedp/chromedp any allocator flag can I put in the config? thank you!
0
votes
1 answer

It is good to use proxy in the mac environment, but the error page load error net::ERR_TIMED_OUT is reported in the linux environment

opts := append(chromedp.DefaultExecAllocatorOptions[:], chromedp.Flag("headless", true)) if ip != "" { opts = append(opts, chromedp.ProxyServer(ip)) } alloctx, cancel := chromedp.NewExecAllocator(context.Background(), opts...) defer cancel() ctx,…
0
votes
1 answer

Golang Chromedp reload current page until find some html object

chromedp.Navigate(tragetUrl), chromedp.WaitVisible("#button"), chromedp.Click("#button"), Goal: if #button is not exist then reload the current page until button appear and click it The #button appears at random times and depending on the target…
ChouChun
  • 5
  • 1
0
votes
1 answer

chromedp failed to start, read: connection reset by peer

My golang program using chromedp to fetch data from other website. The program is running for 2 weeks and everything looks fine. But all of sudden, it starts failed with the error message "connection reset by peer" I run the docker image on local…
David Z
  • 7
  • 4