标签:des java io for ar html javascript amp
NSString *yourHTMLSourceCodeString = [webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML"];
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(<img src=\"(.*?)\">)+?"
options:NSRegularExpressionCaseInsensitive
error:&error];
NSArray *matches = [regex matchesInString:yourHTMLSourceCodeString
options:0
range:NSMakeRange(0, [yourHTMLSourceCodeString length])];
NSLog(@"total matches %d",[matches count]);
for (NSTextCheckingResult *match in matches) {
NSString *img = [yourHTMLSourceCodeString substringWithRange:[match rangeAtIndex:2]] ;
NSLog(@"img src %@",img);
}
获取UIWbview中的所有图片,布布扣,bubuko.com
标签:des java io for ar html javascript amp
原文地址:http://www.cnblogs.com/zengyanzhi/p/3892104.html