A
A
Alexander Shishkin2021-05-15 17:06:28
Automation
Alexander Shishkin, 2021-05-15 17:06:28

How to make correct if condition for element in Selenium extension?

Good afternoon.
The site displays items from the database line by line.
Interested in the value of a particular with a known class. In 99% of cases, it is the same, but sometimes it comes across a different value from the rest. If such a page comes across, then the script stops working. And even better, but it's probably quite difficult to write the entire line into a separate txt file and continue.

Now I tried to do this (it does not work)

spoiler
609fd4a50cf6e264557655.png


Also, if there are many rows on the page and each one has this class, will it only look at the first row, or will it check all elements with the class? (it is necessary to check everything)

PS I would gladly click with my hands (no), but there are more than 10 million pages.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JokerGTS, 2021-06-09
@JokerGTS

Use try-except with error type? And then append to the file in append mode.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question