Как найти элемент, используя xpath через Selenium
Пробный код:
By.xpath("//*[contains(@class,'a-size-mini a-spacing-none a-color-base s-line-clamp-2') and contains(text(), \"Men's Downshifter 9 Training Shoes\")]"));
HTML:
<h2 class="a-size-mini a-spacing-none a-color-base s-line-clamp-2">
<a class="a-link-normal a-text-normal" href="/Nike-Downshifter-Running-Shoes-Anthracite/dp/B07H84PMGS/ref=sr_1_3?dchild=1&keywords=NIKE+TRAINERS+FOR+MEN&qid=1578766779&sr=8-3">
<span class="a-size-base-plus a-color-base a-text-normal">Men's Downshifter 9 Training Shoes</span>
</a>
</h2>