Get content inside UIWebview

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

  1. macrumors regular

    Joined:
    Oct 13, 2010
    #1
    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

    Code:
    -(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;
    }
     

Share This Page