You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code can work properly, but the efficiency is too low,I have to use splash: wait to wait 5 seconds to ensure that the page load is completed, otherwise I will get a lot of duplicate page code.I have read the information for a long time but did not find an efficient way to deal with this problem.
Is there any way in splash that has a method like selenium implicitlyWait or is there an easier way to fix my problem?
The text was updated successfully, but these errors were encountered:
There is no inplicitlyWait in Splash (yet? it sounds like an interesting idea), but you can do it explicitly, e.g.
functionmain(splash)
splash:set_user_agent(splash.args.ua)
assert(splash:go(splash.args.url))
-- requires Splash 2.3-- todo: use splash:with_timeout here,-- to limit total wait timewhilenotsplash:select('.my-element') dosplash:wait(0.1)
endsplash:select('.my-element'):mouse_click()
splash:wait(0.5) -- todo: wait for another elementreturn {html=splash:html()}
end
I think adding a helper function like wait_for_element to Splash itself is a good idea (just opened scrapinghub/splash#569 for it).
I tried using splash: mouseclick to load the next page and get the code for the next page of the page.
The above code can work properly, but the efficiency is too low,I have to use splash: wait to wait 5 seconds to ensure that the page load is completed, otherwise I will get a lot of duplicate page code.I have read the information for a long time but did not find an efficient way to deal with this problem.
Is there any way in splash that has a method like selenium implicitlyWait or is there an easier way to fix my problem?
The text was updated successfully, but these errors were encountered: