Tyler
Tyler

Reputation: 4709

get text from web page as String

I've got my own implementation of this wrapped up in a function that takes a URL argument but I can't help thinking there must be a nice function that does this already within the Android API.

Does such a function exist?

EDIT: Oops. I would just like the text - not the HTML.

Upvotes: 1

Views: 1091

Answers (1)

Jim Schubert
Jim Schubert

Reputation: 20357

Considering you're pulling the content via http, you're going to have to parse out the HTML elements. The only way around this would be if you're calling a script that will return data in other formats based on a query string, which doesn't sound like what you're asking.

If you'd like a good example of how to parse out the HTML, check out the Wiktionary sample on http://d.android.com, specifically the files:

I doubt that fully answers your question, but I hope it steers you in the right direction.

Upvotes: 2

Related Questions