0
我使用@"document.getElementsByClassName('entry-content')[0].innerHTML";
提取了一個html字符串,並且我已成功獲取HTML響應,並將其存儲在字符串中,問題是我需要刪除名爲「集合形式」的字符串的HTML響應。你們可以幫我。下面是代碼。如何在UIWebview中刪除html字符串中的div標籤
-(void)webViewDidFinishLoad:(UIWebView *)webView1 {
NSLog(@"finish");
[activity hide:YES];
NSString *app;
if (currentPage == 3)
[email protected]"<style>table {font-size:10px;}</style>";
else [email protected]"<style>table {font-size:10px;}</style>";
NSString *temp1 = @"document.getElementsByClassName('entry-content')[0].innerHTML; " ;
NSString *class =[webView1 stringByEvaluatingJavaScriptFromString:temp1];
NSString *localString = [NSString stringWithFormat:@"%@%@",class,app];
[webView1 loadHTMLString:localString baseURL:nil];
webView.hidden = NO;
webView.delegate =nil;
}
這將是適用於類呢? –