0

I have HTML page with code

<td class="c" nowrap>993</td>

i need to parse this and to get 993

I try this code

doc.select("td.c.nowrap").text()

but it is doesnt work. Please, type me correct variant

1 Answer 1

1

nowrap is an attribute so it should be enclosed in square brackets (as per the documentation):

Element e = doc.select("td.c[nowrap]").first();
String number = e.text(); // will be 993

That will select the first instance of a <td> tag that has class="c" and the nowrap attribute.

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.