New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run chromedp on Linux #1108
Comments
Please read the doc to understand the difference between the |
ctx, cancel := chromedp.NewRemoteAllocator(context.Background(), "https://baidu.com")
ctx, cancel = context.WithTimeout(ctx, 30*time.Second)
ctx, cancel = chromedp.NewContext(
ctx,
chromedp.WithLogf(log.Printf),
)
defer cancel()
var htmlContent string
var imgBuf []byte
err := chromedp.Run(ctx,
chromedp.Navigate(url),
chromedp.Sleep(5 * time.Second),
chromedp.FullScreenshot(&imgBuf,100),
) I'm not sure that RemoteAllocator is the key of this issue, I try it and get an error: could not dial "https://www.baidu.com": unexpected websocket scheme: "https" |
- ctx, cancel := chromedp.NewRemoteAllocator(context.Background(), "https://baidu.com")
+ ctx, cancel := chromedp.NewRemoteAllocator(context.Background(), "ws://localhost:9222/")
ctx, cancel = context.WithTimeout(ctx, 30*time.Second)
ctx, cancel = chromedp.NewContext(
ctx,
chromedp.WithLogf(log.Printf),
)
defer cancel()
var htmlContent string
var imgBuf []byte
err := chromedp.Run(ctx,
chromedp.Navigate(url),
chromedp.Sleep(5 * time.Second),
chromedp.FullScreenshot(&imgBuf,100),
) |
What versions are you running?
What did you do? Include clear steps.
What did you expect to see?
I want to run Chromedp on Linux, so I download the Docker image of Chromedp/Headless-shell, but after installing Chrome, I get an error when running my program: exec: "google-chrome": executable file not found in $PATH.
I think my application did not find Headless-shell Chrome. How can I set my program to find it?
What did you see instead?
The text was updated successfully, but these errors were encountered: