N
N
Nik Helnik2021-12-22 16:20:44
Python
Nik Helnik, 2021-12-22 16:20:44

How to make it so that a condition is met due to the existence of an element on the page in Python Selenium?

In Python Selenium, I need to have the program check for the existence of an element on the page, and if it exists, then a certain condition is met. If this element is missing, then the condition is not met and the program executes the code that is written ON THE FOLLOWING LINES (that is, so that it does not stop doing what it is given). Well, for example, the program analyzes everything that is on the page, and here on the page, with a 50% chance, a block may appear in which they are asked to register on the site. I don’t need to register, but somehow I need to get rid of the element (by clicking on the cross), and it pops up (as I said) with a 50% chance, which means the program should analyze the existence of the same element, and IF it exists, then the block is closed, and IF it does not exist, then this piece of code is SIMPLY SKIP.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Python Newbie, 2021-12-22
@AndretcDebylov

Use the toaster search. I already asked this question: https://qna.habr.com/q/1072434

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question