-
Notifications
You must be signed in to change notification settings - Fork 5
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
Error, Create chrome instance: timeout waiting for initial target #1
Comments
web2image is just a very thin wrapper to github.com/knq/chromedp -- so please direct any chromedp related question there, with a simple demo code. To be absolutely honest, I didn't get the headless working either, but documented so only that I can spend less words explaining chromedp -- the web2image is the first useful tool that I build on top of https://github.com/go-easygen/wireframe go wireframe framework. I.e., the web2image is more to showcase wireframe than Thanks |
BTW, to get web2image work the way you show it, github.com/mkideal/cli need to be patched with my pending PR. How did you make it work? I'm just curious. |
Here is my code. When I add -d, i get an error [web2image] Error, Create chrome instance: timeout waiting for initial target. All other params works greate. import (
"os/exec"
"fmt"
)
func GetPageImg() {
r := exec.Command(
"exec/web2image",
"-c", "div.weather-today",
"https://weather.rambler.ru/v-bryanske/", "result.png")
res, _ := r.Output()
fmt.Println(string(res))
} |
Oh, I never imagined that you use web2image like this. If you are using your own go code, why not directly call chromedp, or copy web2image and build you code on top of it? I know you are trying to say web2image is failing, but what I am saying is that, I didn't get headless working either. if you need help on chromedp headless. you need to raise your issue there -- https://github.com/knq/chromedp/issues, not here. |
Thanks a lot for your help. I'll follow your advice. I think sleep flag in web2image doesn't work that's why headless got error. I have tried to do like that. cdp.Sleep(2 * time.Second), // wait for animation to finish
cdp.Screenshot(`.banner-section.third-section`, &buf, cdp.ByQuery), |
Oh, thanks for spotting that. The default for If you need to wait longer, say 8 seconds, use web2image -s 8s ... I.e., that "s" is necessary for |
Thanks, for your tool.
When I try run cmd with headless: web2image -s=100 -w -d -c "div.weather-today" "https://weather.rambler.ru/v-bryanske/" result.png
I've got an error : [web2image] Error, Create chrome instance: timeout waiting for initial target
But without headless, it's ok.
Any help?
The text was updated successfully, but these errors were encountered: