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 8096775
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:33:10+00:00 2026-06-05T21:33:10+00:00

team = hxs.select (‘//table[@class=tablehead/tbody/tr[contains[.@class, player]’) The structure of the web site I whose table

  • 0

team = hxs.select (‘//table[@class=”tablehead”/tbody/tr[contains[.@class, “player”]’)

The structure of the web site I whose table I want to select is as follows:

<html>
 <body>
  <table>
   <tbody>
    <tr>
     <td>...</td>
     <td>...</td>
       ...
    </tr>
   </tbody>
  </table>
 </body>
</html>

Since there are multiple tables in the web site, I only want to select the one whose class is defined as “tablehead”. Also, for that table, I only want to select the tags whose class attributes contain the string “player”. My attempt above looks a bit spotty to begin with. I tried running the crawler, and it says that the line I produced above is an invalid xpath line. Any advice would be nice.

  • 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-06-05T21:33:13+00:00Added an answer on June 5, 2026 at 9:33 pm

    //table[@class=”tablehead”/tbody/tr[contains[.@class, “player”]

    Correcting this results in:

    //table[@class='tablehead']/tbody/tr[contains(@class, 'player')]
    

    This selects every tr the string value of whose class attribute contains the string "player" and that (the tr) is a child of a tbody that is a child of any table in the XML document, whose class attribute has string value "tablehead" .

    XSLT – based verification:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="/">
       <xsl:copy-of select=
        "//table[@class='tablehead']
            /tbody/tr[contains(@class, 'player')]
        "/>
     </xsl:template>
    </xsl:stylesheet>
    

    When this transformation is applied on the provided XML document (made just a little bit more realistic):

    <html>
        <body>
            <table class="tablehead">
                <tbody>
                    <tr class="major-player">
                        <td>player1</td>
                        <td>player2</td>
                    </tr>
                </tbody>
            </table>
        </body>
    </html>
    

    the Xpath expression is evaluated and the selected nodes (just one in this case) are copied to the output:

    <tr class="major-player">
       <td>player1</td>
       <td>player2</td>
    </tr>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My team has a super long folder structure that I have to click through
Team S are remote from team C. Team S create a WCF web service
My team uses Team City to do continuous builds and deployment of our Web
My team is developing a new service oriented product with a web front-end. In
My team is taking over an existing web product that is made up of
My team has been tasked with designing a web application that is workflow driven.
Our team at work chose to develop web services using all the tools that
Team, I have an ASP.NET MVC application that I'm deploying. When I deploy it
Team Foundation Server 2008 allows that every check-in is associated with a work item,
My team and I are currently developing an application for both Android and iOS

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.