LoginSignup
0
0

More than 1 year has passed since last update.

備忘録 selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document の解決法

Posted at

seleniumで画像を一斉に取得してくるプログラムを使用していました。しかし、ある日急にタイトルにもある

selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document

のエラーが表示されました。

ページドキュメントが添付されていない?昨日まで動いていたのに、、、と思いエラーでググっていたところ以下の記事を見つけました。
https://blog.ikappio.com/wait-for-elements-to-display-in-selenium-python3/

これによるとsleepの時間で要素が読み込めなかった可能性があるみたい。早速time.sleepの時間を1秒から3秒にしてみたところ解決しました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0