ciao essendo nuovo con selenium, ho bisogno di aiuto per cliccare un "bottone" tra due button tags. Ho provato a usare find_element_by_tag_name, ma non funziona perche ci sono altri button tag sparsi nel codice, in caso avreste un metodo magari anche usando un for su come considerare tutti i button tag cosi che poi possa considerare solo quello che mi serve? Se invece provassi find_element_by_class_name o by_xpath mi dice che non ha trovato nulla e quindi mi ritorna un eccezione . Qualcuno potrebbe aiutarmi perfavore? Questo è il codice:
dovrei premere il pulsante ok che è il secondo "bottone".
HTML:
<div class="footer--1L-3T">
<div class="buttonContainer--33jjD" data-role="button-container">
<div class="buttonContainerItem--286mU restrictedMinWidth--1yzrO" data-role="button-container-item">
<button class="button--3h5xe buttonSizeDefault--3mQ1i buttonStateDefault--3rSF6
buttonLabelPositionInside--2JRkN buttonIconPositionLeft--2FL2w buttonThemePopup--38gEr
buttonModeDesktop--i3Cpv buttonFitWidth--2WSgF" data-role="button" tabindex="-1">
<span data-role="button-bordered" class="bordered--3kSwE roundingBoth--177dl">
<span data-role="button-label" class="label--2kPAA labelCapitalized--3pF45">Exit</span>
</span>
</button>
</div>
<div class="buttonContainerItem--286mU restrictedMinWidth--1yzrO" data-role="button-container-item">
<button class="button--3h5xe buttonSizeDefault--3mQ1i buttonStateDefault--3rSF6
buttonLabelPositionInside--2JRkN buttonIconPositionLeft--2FL2w buttonThemePopup--38gEr
buttonModeDesktop--i3Cpv buttonFitWidth--2WSgF" data-role="button" tabindex="-1">
<span data-role="button-bordered" class="bordered--3kSwE roundingBoth--177dl">
<span data-role="button-label" class="label--2kPAA labelCapitalized--3pF45">OK</span>
</span>
</button>
</div>
</div>
Ultima modifica da un moderatore: