How can I send a click to the following elements using Selenium?
Note: They are placed at the same page and both of them have the same class "btn btn-primary"
<button class="btn btn-primary" data-ng-click="ctrl.findInstrumentsBySearch(ctrl.filterInstrument);" data-ng-disabled="ctrl.disableButtonSearchInstrument();">
<span class="fa fa-search"></span> Pesquisar
</button>
<button class="btn btn-primary" data-ng-click="ctrl.downloadLimitInstrumentCsv(ctrl.filterInstrument,{ filename: "export.csv" });">
<span class="fa fa-file-excel-o"></span> Exportar
</button>
When I try to use the following I receive the error "IndexError: list index out of range":
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
browser = webdriver.Chrome()
browser.get(("https://line.bvmfnet.com.br/#/limits/1"))
python_button = browser.find_elements_by_xpath("//button[@class='btn btn-primary' and @data-ng-click='ctrl.findInstrumentsBySearch(ctrl.filterInstrument)']")[0]
python_button.click()