有关wkwebview和UIwebview获取html中的标签方法

时间:2017-03-24 12:20:21   收藏:0   阅读:1457

 wkwebview方法如下:

[webView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
        NSString *string=result;
        NSLog(@"result====%@",string);
    }];

 

uiwebview方法如下:

UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectZero];
NSString *string = [webView stringByEvaluatingJavaScriptFromString:@"navigator.userAgent"];
评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!