Closed biter777 closed 5 years ago
Hi, it looks like the page isn't loading for some reason. I would recommend enabling logging for the protocol, it can give you some information on why it isn't working.
Example here.
Thanks for your response!
I did some tests. Event "load" does not come if the site uses some js-scripts. I do not know why this is happening.
I'm currently using SetLifecycleEventsEnabled, and waiting for the event "networkIdle". It works fine, but not kosher. )
Tell me, if possible, how can I get a list of frames on the page and organize the waiting load for each of the frames? I tried through Debugger interface, but without success.
There was a similar issue previously in #67, probably a bug in Chrome. As an alternative you could try DOMContentEventFired
instead. Still though, waiting for networkIdle
could be a pretty good solution since there's no guarantee that resources have been loaded by the time LoadEventFired
or DOMContentEventFired
happen.
Still, as an option, we can disable unnecessary scripts on the page via Emulation.SetScriptExecutionDisabled()
.
But I do not know how to get a list of scripts on the page.
Hello,
Was exactly looking for how we could listen for the networkidle
event.
How can we achieve that with the package?
Thanks in advance!
@AlaNDGT use the Page domain to first enable lifecycle events and then listen to them via the event client.
Hello,
Was exactly looking for how we could listen for the
networkidle
event.How can we achieve that with the package?
Thanks in advance!
err = t.Page.SetLifecycleEventsEnabled(ctx, page.NewSetLifecycleEventsEnabledArgs(true))
...
events, err := t.Page.LifecycleEvent(ctx)
...
defer events.Close()
for ... {
event, err := events.Recv()
...
}
@mafredri @biter777 Oh thanks!
Hi!
Need some help, if possible. I have a navigate func, but loadEventFired.Recv() always catches a "deadline". If i use a "t.Page.DOMContentEventFired(ctx)" instead of "t.Page.LoadEventFired(ctx)" its ok. I tried both Chrome and Chromium.
What can be wrong?