A
A
AmirDigiev2018-09-30 14:56:59
Python
AmirDigiev, 2018-09-30 14:56:59

How to click multiple buttons at the same time on selenium python?

While writing the parser, avito faced the problem of a large number of buttons on the site. I can click on one, but several do not come out. Is there such a thing in selenium at all? I thought to try through the loop, it does not work:

driver = webdriver.Edge()
driver.get('https://www.avito.ru/moskva/nedvizhimost')

    soup = BeautifulSoup(html, 'lxml')
    button = soup.find_all('button', class_ = 'button button-origin button-origin_large button-origin_full-width recommendations-show-more js-recommendations-show-more')

    for button_click in button:
        button = driver.find_element_by_xpath('//button[@class="button button-origin button-origin_large button-origin_full-width recommendations-show-more js-recommendations-show-more"]').click()

HELP!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nickname111, 2018-09-30
@Nickname111

for button_click in button:
    button_click.click()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question