Search code examples
pythonseleniumhelium

Waiting for an element to appear in a Helium script


I use Helium to automate a web page. The problem is that I sometimes get a LookupError because an element is not yet present on the page when Helium searches for it. Is there a way to wait until the element is there?


Solution

  • You can use wait_until(...). For example:

    wait_until(Button('Download').exists)