0

I am trying to select the href for Exhibit 2 using a CSS selector

<td>
  Order Granting Debtors' Motion for Entry of Order (I) Establishing a General Bar Date   to File Proofs of Claim, (II) Establishing a Bar Date to File Proofs of Claim by Governmental Units, (III) Establishing an Amended Schedules Bar Date, (IV) Establishing a Rejection Damages Bar Date, (V) Approving the Form and Manner for Filing Proofs of Claim, (VI) Approving the Proposed Notice of Bar Dates, and (VII) Granting Related Relief (Related Doc # 
<a href="/Clients/ViewDocument?dataDir=rps&amp;casen=24-12564&amp;docketn=189">189</a>, <a href="/Clients/ViewDocument?dataDir=rps&amp;casen=24-12564&amp;docketn=198">198</a>) Order Signed on 1/16/2025. Government Proof of Claim due by 5/5/2025. (Attachments: # 
<a href="/Clients/ViewAttachment?dataDir=rps&amp;casen=24-12564&amp;docketn=199&amp;partn=2">1</a> Exhibit 1 # 
<a href="/Clients/ViewAttachment?dataDir=rps&amp;casen=24-12564&amp;docketn=199&amp;partn=3">2</a> Exhibit 2 # 
<a href="/Clients/ViewAttachment?dataDir=rps&amp;casen=24-12564&amp;docketn=199&amp;partn=4">3</a> Exhibit 3) (Mml) (Entered: 01/16/2025)
<a class="email-launcher" href="#" data-docid="328347"><i class="fa fa-envelope-o"></i>Email</a>
</td>
td > a[href^="/Clients/ViewAttachment?"] 

gets all three tags...How can I select a specific one using CSS selector? I tried

td > a[href^="/Clients/ViewAttachment?"]:first-of-type + a 

and it didn't work. I would specifically like to select the second of the three tags. The a tags are all children of the td tag...I couldn't get it to indent when I pasted it.

4
  • This question is similar to: nth-child selector in css. If you believe it’s different, please edit the question, make it clear how it’s different and/or how the answers on that question are not helpful for your problem. Commented Jan 18 at 4:08
  • Unless there are more than one <td> with multiple <a> inside, it can be td a:nth-child(2). a <td> infers that there is usually multiple <td>. If that solution doesn't work you'll need to post the rest of the Html in a minimal reproducible example. Commented Jan 18 at 21:44
  • 1
    td > :nth-child(2 of [href^="/Clients/ViewAttachment?"]) - check if browser support of the of <selector> syntax is enough for your needs, developer.mozilla.org/en-US/docs/Web/CSS/… Commented Jan 20 at 8:12
  • @C3roe that worked perfectly! Commented Jan 21 at 22:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.