0

I'm trying to parse text inside SPAN and it's causing me some trouble.

HTML code for what I'm trying to parse:

<span title="Geografija">GEO</span>

My selector syntax:

Elements eles = doc.select("table.ednevnik-seznam_ur_teden tbody tr:eq(2) span");

This is what I get:

<span title="Geografija">GEO</span>

It literally parses the HTML code, but I'm trying to only parse the text inside span element. In this case, I should get this:

GEO

What am I doing wrong here?

1
  • Thanks, I must've missclicked the suggested tags Commented Dec 29, 2013 at 14:02

1 Answer 1

2

If you want the text of the element, get the element from your list (perhaps using Elements#first or Elements#get), then use Element#text to get the element's text.

Sign up to request clarification or add additional context in comments.

Comments

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.