-
Notifications
You must be signed in to change notification settings - Fork 505
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
Question: how to wait for page loads #606
Comments
@jambonnade You may refer to this sample wait for a specific element to load script. function wait_for_element(splash, css, maxwait)
]], css, maxwait)) function main(splash) |
The above example works but it has a problem. If the page reloads, it interrupts the script execution. So I wrote a function purely in lua to handle this kind of problem.
|
Apparently the above function has high cpu usage, not sure why. I don't recommend using it |
Hi,
First, i'd like to know exactly when the splash:go() call returns :
Then how should we deal with scripts going through multiple pages without additional go() calls ? (ex : click on links, form submits)
Using wait() with cancel_on_redirect flag is a good start but again i don't know when wait() returns exactly in this case.
I don't find it's a serious way to add wait() calls with random timings to let the page finish loading, so if there is no designed way for this, i may do something like : check at some interval that the page has a specific html element or if there is a javascript variable indicating that the new page is loaded
Thanks
The text was updated successfully, but these errors were encountered: