問題タブ [expected-condition]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
python - PythonでSeleniumのWebDriverWaitを適切に使用するには?
Just thought I'd add an edit now that this has been resolved. Replacing those 2 time.sleep() took my program from 180 seconds down to 30. WebDriverWait creates a substantial improvement in runtime.
Just trying to determine if I'm setting up WebDriverWait correctly. This is my working script, I use time.sleep()
In short, it goes through a table, clicks a button which opens a pop up, extracts text from pop up, and closes said pop up. I have to wait for the pop up to open, and to fully close. I'm currently using time.sleep(), but I'm trying to switch to WebDriverWait. This is how I've implemented it.
However, the above does not work. And I receive this error:
time.sleep() に戻ると、これはなくなったので、WebDriverWait を間違って設定したに違いないと思います。待機はブラウザの開閉のためなので、ボタンが表示されるまで待たなければならないので、ボタン自体のxpathをWebDriverWaitに入れています。これは適切な設定ですか?
編集:答えてくれてありがとう@DebanjanB。ただし、time.sleep() を削除しようとしているときに別の問題に遭遇しました。これは現在私が持っているものです。
上記の time.sleep() は、データを抽出する前に、(前のクリックから) ポップアップが開くのを待っています。以下の #WebDriver で time.sleep を削除すると、まだ先に進みますが、何らかの理由で seq_info.text が空白になります (テキストが見つかりません)。なぜこれが起こっているのかよくわかりません。これはクリックやボタンではありません。ポップアップから情報を抽出する前に、ポップアップが開いていることを確認したかっただけです。