I'm submitting a login form and trying to capture the HTML afterwards using elixir / hound. After submitting I run page_source
and get nothing. If I wait for a second (for the page to finish loading) then I get back the html.
Is there a way to make hound wait till the page is finished loading?
I'm currently doing: :timer.sleep(2000)
as a work around, hoping for a better way :/
This is what I do:
Create a function that repeatedly checks for a test condition every 100ms, in this case I'm waiting for particular text to appear by using visible_page_text