Title: live content from html to html
Tags: html;xcode;uiwebview;live
Question: I'm using UIWebView to display data from my organization data (publicize and legal), however, for instance, I would only want to pull specific data from the html file rather than pulling the whole URL. e.g. I want to pull the "News" section of the html and I want the user to only stay in that page, not enabling them to go into other parts of the website (e.g. home page, contact us) and allowing them to view the PDF article on the HTML file.
I've asked around and read up on DOM and screen scraping, but it seem that the data pulled are stored in a database instead.
Is there any way that I can pull just the HTML "News" section with the PDF URL into my customized HTML file and that it will be updated live (maybe every 30second it will refresh and pull information from the website so that the content and list of PDF are up to date)(e.g. added in 3new article into the main website, my customize HTML file will also refresh and pull information from website and update my article list)
If anyone can point to me a specific method that allow HTML to HTML data passing (live), that will be great and I can go do more research on it. Currently very lost and confuse as it is my first time doing this. Any help/feedback will be very much appreciated :)
EDIT: For example, google map or google search. I don't want to use the whole google webpage, just taking the important thing that i want like the search result or map display.
Comment: Not sure what you mean by HTML to HTML data passing, do you think you could post some pseudo code of what you'd like to do?

Comment: I  want to take partial information from 1 HTML file and display it on another HTML file (live data, constantly updated). I don't have any code as of now because I'm not even sure how to start off writing it. I've did some research on DOM and screen scraping, but they don't seem to be what I want.

Here is the accepted answer: This will involve quite a lot of learning on your part - you'll have to learn HTML / the DOM / JavaScript and iOS/UIWebVIew.
Lets leave the live refresh part for now, I'll post another answer or edit to that later on.
That's not going to easy either (check out my earlier posting today on background execution issues that will affect you, unless the update is only to take place in the foreground
iOS Run Code Once a Day)
You will have to do something like this. And note that I've never tried this, nor seen posting of people who have on here, but in theory it should work, but there will be a lot of learning as I've said, and lots of trial and error. Its a big task when you're not familiar with these things.
1) Download the html page and load it in a UIWebView, but that UIWebView is hidden so the user's can't see it.
2) When the page has loaded its dom will be accessable.
3) You can use Javascript to access the DOM and look for the parts you want.
How you inject and run the Javascript in UIWebView can be answered in a separate question (this answer will get too long if all the exact details are included).
4) Remove the parts of the dom you are not interested in. Or use use events to make only those parts you are interested in appear, jQuery can probably help here.
5) Display the UIWebView
Alternatively the HTML could be saved to a file and string parsing could be used to search for the bits you are looking for and create a new text html file from it. I think this would get very messy, better to take advantage of the fact that UIWebView will parse the HTML page and create the dom for you.
Comment for this answer: That's right, ask more detailed questions as you do each part bit by bit.
Comment for this answer: I get the gist of what you're trying to imply, and that is what I want as well. So by using jsp, I will be able to block out parts which I don't want the HTML to load? Correct me if I'm wrong, but with this setting, all I will need is to use UIWebView to load the HTML(still hidden), use jsp to access the DOM to block out parts on the HTML, UIWebView hidden = NO. object required -> UIWebView, downloaded HTML, jsp to block out part, 2nd jsp to implement live refresh.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2012:00:06/05/12', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<html><xcode><uiwebview><live>', 'Title': 'live content from html to html', 'ViewCount': 521, 'id': 10891048, 'user_AboutMe': '<p>Newbie to everything, please guide me ^.^</p>\n', 'user_AccountId': 1459305.0, 'user_DisplayName': 'Yang Jie Domodomo', 'user_Reputation': 685.0, 'user_Views': 114.0, 'user_id': 1374048.0}}