3 ms·
Regarding selenium, is there a better way to wait for a specific state or element etc rather than simply sleep for a few seconds?
by adzm 7y ago
Regarding selenium, is there a better way to wait for a specific state or element etc rather than simply sleep for a few seconds?
- kyoob 7y agoIt's considered a better practice to explicitly wait for an element on a page before acting. How to do it is documented for the Python bindings here: https://selenium-python.readthedocs.io/waits.html https://selenium-python.readthedocs.io/waits.html
- deleted 7y ago[deleted]
- anaphor 7y agoI'm working on fixing that, however it's a bit tricky because Facebook does some very weird things with Javascript that seem to interfere with Selenium. In particular, the only way I could get it to actually focus on the "Delete" button was by dropping down to Javascript. I'm not sure why this was. I also ran into issues with the Gecko driver initially where I couldn't get it to open the delete menu at all.