I have a web page with more few buttons with same class and name and when clicked they just disappear and do nothing. So I first tried this but it didn't work:
buttons = driver.find_elements_by_xpath('//*[@class="btn"]')
buttons[1].click()
buttons = driver.find_elements_by_xpath('//*[@class="btn"]')
buttons[2].click()
buttons = driver.find_elements_by_xpath('//*[@class="btn"]')
buttons[3].click()
And then found a solution with:
buttons = driver.find_elements_by_xpath('//*[@class="btn"]')
buttons[1].send_keys('\n')
I am new to Python so can anyone explain me what is the reason for not working with click but with send_keys('\n')?