Answer the question
In order to leave comments, you need to log in
How to get rid of the selenium crash if the element is not found?
Hello, I recently started playing one browser game and I was impatient to write a bot to it according to this information . HABR, without thinking twice, wrote a simple crafter for myself, the essence of which is just pressing two buttons, but the problem I encountered is finding things in a backpack and when the desired thing no, the script simply crashes and refuses to work, in fact, that's the whole problem
Answer the question
In order to leave comments, you need to log in
it is possible to write a function for checking an element, and before clicking (or simply interacting with the element), this function checks whether this element exists and whether it is available. The function is also based on try-catch-exception and a pair of if else.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question