Below is a snippet of how a page is set up.
<class id="class1">
<ul>
<li>
<strong>section 1</strong>
<a href="link.com/home1">some link 1</a>
<li>
<strong>section 2</strong>
<a href="link.com/home">some link 2</a>
<class id="class1">
<ul>
<li>
<strong>section 3</strong>
<a href="link.com/home/abc">some link 3</a>
<li>
<strong>section 4</strong>
<a href="link.com/home/def">some link 4</a>
how do i locate link.com/home in section 2?
I figured this would work:
.class1:nth-of-type(1) li:nth-child(2) [href*="/home"]
But it doesn't. It finds the link in section 4 as well. I have to use *= because in different environments the url prefix changes.