タグ

ブックマーク / blog.ikappio.com (1)

  • Python3 Seleniumの要素取得時の待機

    Seleniumの明示的待機について 以下のようなエラーが要素取得時に発生する。 selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document 要素がページ中にアタッチされてないそうだ。 5. Waits — Selenium Python Bindings 2 documentation が参考になる。2種類の待機がある。 明示的な待機 特定要素が特定の状態になるまで、要素の取得を待つというもの。 今までの要素の取得は、 # 待機しない例 element = driver.find_element_by_css_selector('CSS_SELECTOR') だった。ここで要

    Python3 Seleniumの要素取得時の待機
  • 1