3

In my UIWebView I loaded the "Chapter.xhtml" file like this.

[webView loadRequest:[NSURLRequest requestWithURL:url]];  

and the whole Chapter.xhtml is loaded in webView.

I am showing it with some JavaScript logic in the webview.

float pageOffset = pageIndex*webView.bounds.size.width;
NSString* goTo =[NSString stringWithFormat:@"pageScroll(%f)", pageOffset];
[webView stringByEvaluatingJavaScriptFromString:goTo];  

From this the New page will come as the button is pressed but page scrolling manually off in webview.

So, if there are four pages with content in the webview, then only one page will come in the webview and as the "next" button is pressed the new page will come.

But I need to get all the HTML tags that are seen on the screen. (only those which are on the screen) not whole loaded HTML in webview.

For getting HTML tags I use NSXMLParser and got all tags in the didStartElement method and values in the foundCharacters method.

But, I want to get only that tag that is on the screen and after second page tag and so on....

Any idea or suggestion will be helpful to me...

EDIT :
For example if there are three pages of HTML loaded in the webview then only one page is seen on the screen, and then by adding the height of the webview * page, the next page will come on screen but that page was also loaded in the webview, just not seen on screen.

So is there anything that will give me those tags that are on screen. (or whose values are on the screen)?

Simon
  • 3,667
  • 1
  • 35
  • 49
Sam
  • 431
  • 7
  • 23
  • use webview delegate method `-(BOOL)webView:(UIWebView *)webiew shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{ NSURL* url = [request URL]; NSLog(@"Url is :%@",url);}` – Mohit Aug 22 '14 at 11:08
  • No man... it's just give me the URL Loaded in webview. i need just that tag or content that is on screen. not whole URL. any CUT or split HTML thing do you know that will give whatever content is on screen. – Sam Aug 22 '14 at 11:18

0 Answers0