How to read UIWebView Data. i want to read View Source of the url in the UIWebView. anybody has any idea then let me know.
Thank you.
You should do
NSString *html = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"www.apple.com"]];
However if you're determined to use the UIWebView to get the HTML, you can try
NSString *html = [webView stringByEvaluatingJavaScriptFromString:@"document.documentElement.outerHTML"];
or
NSString *html = [webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With