I am trying to scrap the website https://www.wlw.de/de/suche?employeeCounts=200%2B_50-199&q=blechbearbeitung&supplierTypes=Dienstleister_Hersteller with multiple repetitive divs elements that each has a see-more button to show the hidden data in the div I tried to find buttons using Selenium in Python with this code
for i in range(len(company_names)):
seemore_button = driver.find_elements(By.CLASS_NAME, 'toggle-button')[i]
seemore_button.click()
time.sleep(2)
Where company_names is the name of each div and I am using its length to loop on all divs but it doesn't work, when I run this code the chrome driver acts as clicking on buttons but when it finishes I find that not all the buttons have been clicked I thought at first that it may be because of the page can't load as fast as the code clicks the buttons so I added a sleep time of 2 seconds and the same result, sometimes the buttons are clicked and sometimes no