PDA

View Full Version : Get content inside UIWebview




Nnavick
Apr 29, 2011, 01:04 PM
Hi,
How do I take the content that the webview shows?
I wrote this function but it's working only on visual webview(IBOutlet)
and it's take a moment(or two :mad:) to the webview to show the content
this is the function

-(NSString*)IsServerResponding:(UIWebView *)BackgroundLoader:(UITextField*)Username:(UITextField*)Password:(UILabel*)Error {
NSString *BackgroundLoaderText =[BackgroundLoader stringByEvaluatingJavaScriptFromString:@"document.documentElement.innerText"];
if (([BackgroundLoaderText rangeOfString:@""].location == NSNotFound)&&([Username.text length]>0)&&([Password.text length]>0)) {
Error.text=BackgroundLoaderText;
if([BackgroundLoaderText isEqualToString:@""]) {
return @"Server is not responding";
}
}
return BackgroundLoaderText;
}