F
F
FastOwl6662021-02-25 23:48:04
Python
FastOwl666, 2021-02-25 23:48:04

Selenium WD How to click on a block without a defined class?

Let's say I have a block with the class "hello" in which there are three more blocks without classes.
How do I click on each in turn?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2021-02-25
@FastOwl666

Find your block . From it already find others and clickhello = driver.find_element_by_class_name('hello')

elements = hello.find_elements_by_tag_name('ну тут тег')
for el in elements:
    el.click()

Or search everything at once through xpath

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question