This is a button I want to click :
<a id="BUTTON_GROUP_ITEM_A5_btn4_acButton" ct="B" st="" href="javascript:void(0);" ti="0" tabindex="0" class="urBtnStd" ocl="sapbi_buttonGroup_callCustomScript([['CUSTOMFUNCTION','ExportXLSCM',0]],event);" onkeydown="ur_Button_keypress(event);" onclick="ur_Button_click(event);" style="min-width: !important;text-align:center;overflow:visible;">Export to Excel</a>
I've used the following methods:
button = driver.find_element_by_link_text('Export to Excel')
button.click()
button = driver.find_element_by_xpath("//a[contains(@id, 'BUTTON_GROUP_ITEM_A5_btn4_acButton')]")
button.click()
#Using full xPath
button = driver.find_element_by_xpath("/html/body/table[2]/tbody/tr/td/div[2]/div[1]/div/table[1]/tbody/tr/td[3]/div/span[5]/a")
button.click()
but they all give selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element error
Any idea how to fix this or to even print all the elements on the page so that I can find out what to 'click'? I've tried so many ways but all are giving the same error. Thanks!
