Get content inside UIWebview

Discussion in 'iOS Programming' started by Nnavick, Apr 29, 2011.

  1. Nnavick macrumors regular

    Oct 13, 2010
    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)) {
           if([BackgroundLoaderText isEqualToString:@""]) {
               return @"Server is not responding";
       return BackgroundLoaderText;

Share This Page