How can I save and continue if WebDriverWait did not find the class

I want that if WebDriverWait didn’t find what it was looking for, continue the cycle and save it in the database, I tried giving the src_iframe variable and checking if not src_iframe but it didn’t help

` try: drivers.get(film_url)

                    iframe = WebDriverWait(drivers, 8).until(
                        ec.presence_of_element_located((By.ID, "cinemaplayer-iframe"))
                    )

                    src_iframe = WebDriverWait(drivers, 8).until(
                        lambda d: iframe.get_attribute('src') != ''
                    )
                    
                    if not src_iframe:
                        film_instance.is_completed2 = True
                        film_instance.save()
                        continue

`

Вернуться на верх