Из следующего HTML-кода я пытаюсь выбрать с использованием Selenium WebDriver, однако, похоже, я не могу, потому что у элементов есть идентификаторы жидкости. Как я могу найти такие элементы? Я не могу использовать By.className("cs-autocomplete-input")
, потому что на веб-странице есть несколько элементов с этим именем класса.Поиск элементов с флюидами xpaths с селеном
<div class="content">
<div id="fluid-id-bhlpjo3p-1026">
<input type="button" class="csc-repeatable-add-bhlpjo3p-1022 cs-repeatable-add" value="+">
<ul class="cs-repeatable">
<li class="csc-repeatable-repeat-bhlpjo3p-1022 clearfix cs-repeatable-repeat show">
<input type="radio" class="csc-repeatable-primary-bhlpjo3p-1022 show cs-repeatable-primary" name="primary-fields.sponsors" value="true">
<input type="text" class="csc-exhibition-sponsor cs-repeatable-content" id="repeat::.csc-exhibition-sponsor" name="repeat::.csc-exhibition-sponsor" style="display: none;">
<input class="cs-autocomplete-input" tabindex="">
<a href="#" class="cs-autocomplete-closebutton" title="Cancel edit, and return this field to the most recent authority value" style="display: none;"></a>
<input type="button" value="" class="csc-repeatable-delete-bhlpjo3p-1022 cs-repeatable-delete" disabled="">
</li>
</ul>
</div>
Не уверен, что это полезно, но XPath этого DIV является //*[@id="primaryTab"]/div/div[3]/div[1]/div[2]/div[2]/div[1]/div/div[2]
Спасибо так много! Это сработало – ceez