Answer the question
In order to leave comments, you need to log in
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()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question