Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:46:12+00:00 2026-05-31T22:46:12+00:00

Simplified example <td>caption</a> <a id=tt-1>text1</a> <a id=tt-2>text2</a> <td>topics</td> <a id=tt-3>text3</a> <a id=tt-4>text4</a> <a id=tt-5>text5</a>

  • 0

Simplified example

<td>caption</a>
<a id="tt-1">text1</a>
<a id="tt-2">text2</a>
<td>topics</td>
<a id="tt-3">text3</a>
<a id="tt-4">text4</a>
<a id="tt-5">text5</a>

What I need is to match all a elements below <td>topics</td>.
Note that there are plenty of elements between those elements in example. Also <td> may be enclosed into other elements.

My current real-world XPath expression looks like this

//a[contains(@id,'tt-')]

Updated to be closer to real-world

Another update to clarify.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:46:13+00:00Added an answer on May 31, 2026 at 10:46 pm

    Based on your statement “What I need is to match all a elements below <td>topics</td>“

    //td[.='topics']/a
    

    I’m sure that’s not the whole story, though.

    Based on your updated example:

    //a[starts-with(@id, 'tt-') and preceding-sibling::td[1] = 'topics']
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Note that all the code is a simplified example in order to only communicate
The simplified example this; picture a Venn diagram made from two elements, A and
Given the simplified example below, how would I access my custom current_status property within
In the following simplified example, I need to abstract Collection classes in such a
In the following simplified example, I need to abstract Collection classes in such a
Below is a simplified example of a stored procedure I've created. DELIMITER // CREATE
Below is a simplified example of what I want to do. In the actual
OK, below is a simplified example of what I have to do. So far
Consider the overly simplified example below; some of it written with pseudocode for brevity.
Below is simplified example of what I am trying to achieve: class Product(models.Model): #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.