0

I'm trying to apply regex in my android code to get a specific value from a HTML page. The HTML code is :

    <html>
<head>
<title>Sometitle</title>
<body>
<span class="shout">VAL 32354</span>
</body>
</html>

my aim is to extract this text "VAL 32354" from the above mentioned HTML code ? I've searched long for regex with android and I found rare number of tutorials which were are all complicated for a beginner programmer like me . Any thoughts how to do that ? and thanks in advance

Note : if regex doesn't work in this case , what are the alternatives ?

7

1 Answer 1

2

Why not use Jsoup to parse the HTML?

See http://www.survivingwithandroid.com/2014/04/parsing-html-in-android-with-jsoup.html

In this example, you could get the element with Elements shoutList = doc.select("#shout");

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

1 Comment

That's really a live saving answer =)

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.