Reputation: 688
I have loaded an UIWebView
with .rtf file.
Now, I want to get all HTML elements or elements present inside the UIWebView
. Is there any method available to get it?
Thanks for your answers.
Upvotes: 1
Views: 3353
Reputation: 3920
You could use JavaScript to get the element...
NSString *javaScript = @"document.getElementById( YOU ID );";
NSString *response = [webView stringByEvaluatingJavaScriptFromString:javaScript];
Hope that helps...
Upvotes: 3
Reputation: 5616
You can get all of the HTML
content of your UIWebView
with the call:
NSString *yourHTMLSourceCodeString = [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.outerHTML"];
After this it's up to you.
Upvotes: 3