有关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)