4

Except TimeoutErrorタイムアウトの問題を処理するために使用したい。しかし、スクリプトは常に TimeoutError をスローし、計画どおりにメッセージを出力しません。

これが私のコードです:

try:
    await page.wait_for_selector("#winiframe_main", timeout=10000, state='detached')
    print("The frame is detached.")
except TimeoutError:
    print("The frame is not detached")

私のコードに何か問題がありますか?

4

1 に答える 1