How to get the HTML tag that is displayed on the UIWebView screen from the entire HTML tag loaded in the UIWebView

In mine UIWebView

I have uploaded the "Chapter.xhtml" file like this.

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

      

and the whole Chapter.xhtml file is loaded into the webView.

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

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

      

With this, a new page will appear when the button is clicked, but manually scrolling the page in the webview.

So, if there are four content pages in the webview, then only one page will appear in the web browser, and when you click Next, a new page will come.

But I need to get all the HTML tags that are visible on the screen. ( only the ones on screen ) and not all the loaded HTML in the webview.

For getting HTML tags I use NSXMLParser and get all tags in method didStartElement

and values ​​in method foundCharacters

.

But I only want to get the tags that are on the screen and after the second page tag, etc ...

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

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

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

+3


source to share





All Articles