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

  • Home
  • SEARCH
  • 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 8077273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:26:22+00:00 2026-06-05T15:26:22+00:00

When i tried using the below code…the td tag is returned and not the

  • 0

When i tried using the below code…the td tag is returned and not the value of the td tag.

List<?> byXPath = page2.getByXPath("//tr[@class='metadata odd']/td");
System.out.println(byXPath.get(0).toString());

For ex:If the tag is

<td class='metadata odd'>Arun</td>

The result was

<td class='metadata odd'>

…. I need the result to be Arun. Kindly help

  • 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-05T15:26:23+00:00Added an answer on June 5, 2026 at 3:26 pm

    What you’re looking for is actually the string representation of the text child node of the td tag, not the string representation of the td element itself, which you are requesting at the moment.
    Use a slightly different XPath expression to reference the text child node directly, like this:

    List<?> byXPath = page2.getByXPath("//tr[@class='metadata odd']/td/text()");
    DomText textNode = (DomText)(byXPath.get(0));
    System.out.println(textNode.toString());
    

    See also this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tried accessing web for xml parsing using the code below: System.Uri proxy =
I tried to send an email using this class below, but no success, no
I just cant get this working. I tried using the code below with onTouchEventand
I tried using the code below to set up a contextmenu which only displays
I have tried using the code below to display ImageIcons in JTable. But when
I tried created an XML file using below code. $xml = new SimpleXMLElement('<xml />');
I have tried using the below code modified from http://www.html5rocks.com/tutorials/file/dndfiles/ to read in a
I have tried using the code below but it only display results in Chrome
How does string.join resolve? I tried using it as below: import string list_of_str =
I tried using Exist and IN. Not only did I not succeed, it didn't

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.