1

I need to click on button "exportar". How can I do this?

<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>

Ive been trying with but got nothing up to now. like

bot.FindElementByXPath("//div[@class='ui-dialog-buttonset']/following-sibling::button/span").Click

or

bot.find_element_by_xpath ("//span[text()='Exportar']")
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

To click() on the element with text as Exportar you can use either of the following Locator Strategies:

  • Using FindElementByCss:

    bot.FindElementByCss("div.ui-dialog-buttonset > button.ui-button.ui-widget.ui-state-default.ui-corner-all.ui-button-text-only.button-default > span.ui-button-text").click
    
  • Using FindElementByXPath:

    bot.FindElementByXPath("//button[@class='ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only button-default']/span[@class='ui-button-text' and text()='Exportar']").click
    
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352