【发布时间】:2021-05-03 11:42:45
【问题描述】:
我需要点击“exportar”按钮。我该怎么做?
<div class="ui-dialog-buttonset"><button type="button" title="" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only button-default" role="button" aria-disabled="false"><span class="ui-button-text">Exportar</span></button><button type="button" title="" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only button-cancel" role="button" aria-disabled="false"><span class="ui-button-text">CANCELAR</span></button></div>
我一直在尝试,但到目前为止一无所获。喜欢
bot.FindElementByXPath("//div[@class='ui-dialog-buttonset']/following-sibling::button/span").Click
或
bot.find_element_by_xpath ("//span[text()='Exportar']")
【问题讨论】:
-
试试这个 bot.find_element_by_css_selector('span.ui-button-text')
标签: vba selenium selenium-webdriver xpath css-selectors