I have one <div> class having <a> tag and <h3> tags and the same <div>. I just wanted to click <a> of that div class based on <h3> text.
As per below example, div class name is "product eq-height" having <h3> tag who has some text "Applet Iphone 5S" if this result found then click on <a> class named "select-device-button".
But this div class comes multiple times with different H3 text on the page.
<div class="product eq-height" style="padding-bottom: 0px ! important; min-height: 329px;">
<h3 class="h4">Apple Iphone 5S</h3>
<input name="productModel" value="Apple Iphone 5S" type="hidden">
<div class="subtitle">
<span>Apple</span>
</div>
<a class="select-device-button" href="javascript:void(0);">
<div class="item">
<img alt="" class="prod-img-lrg lazyloaded" data-src="https://vgeco-oat1.vodafone.com/images/Iphone 5S.jpg" src="https://vgeco-oat1.vodafone.com/images/Iphone 5S.jpg"> <noscript><img alt="" src="https://vgeco-oat1.vodafone.com/images/Iphone 5S.jpg"></noscript>
</div></a>
<div class="info">
<div class="inner">
<ul class="cost">
<li><b>Total cost</b>
</li>
<li class="price">£ 300.00</li>
</ul>
<ul class="cost">
<li><b>My cost</b>
</li>
<li class="price">£ 106.99</li>
</ul>
</div>
<div class="cta">
<a class="btn btn-sml select-device-button" href="javascript:void(0);">Select</a>
</div>
</div>
<div class="co-link-wrap txt-center">
</div>
</div>