IOS Get content from Web page : I need help.I'm trying to get one value from my web page. When i execute first time returns value null but if I execute another time returns correct value...


    NSString *urlString = @"http://localhost/app/check.aspx";
    NSURL *url = [NSURL URLWithString:urlString];
    NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url];
    [_WebView loadRequest:urlRequest];
    NSString *html = [_WebView stringByEvaluatingJavaScriptFromString: @"document.getElementById('Contador').textContent"];
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle: @"Avisos Activos"
                                                   message:html
                                                  delegate: self
                                         cancelButtonTitle:@"Cancel"
                                         otherButtonTitles:@"OK",nil];
    
    [alert setTag:1];
    [alert show];   

Thank's for your help