How to get information from a webpage, but not all?
I am retrying to retreive just the text and the image from this wiki page.
http://en.wikipedia.org/wiki/Where_the_Red_Fern_Grows
I will have a news feed, and when i item is clicked the url will be fetched. Intead of going to a the web开发者_高级运维page through the browser, i would like to get the text and images and feed them into a textview and imageviews.
You have a couple of options.
- Host a intermediary site that parses the link and passes back the data you want.
- Get all of the page, and parse on the device.
Obviously parsing a huge page on the device will be far slower than parsing it on a webserver and serving just what you need.
Of course, if you are really in need of just the text and image, there is some help by using the mobile version of Wikipedia: http://mobile.wikipedia.org OR http://en.m.wikipedia.org
The "mobile" version splits pages up and contains no graphics, but the "m" version is probably more along the lines of what you are looking for.
Here is the formatted page for "Where The Red Fern Grows": http://en.m.wikipedia.org/wiki/Where_the_Red_Fern_Grows
精彩评论