我正在提取一个 html 字符串,@"document.getElementsByClassName('entry-content')[0].innerHTML";
并且我成功地获得了 html 响应,我将它存储在一个字符串中,问题是我需要从字符串中删除一个名为“collections-form”的 div。你能伙计们帮帮我。下面是代码。
-(void)webViewDidFinishLoad:(UIWebView *)webView1 {
NSLog(@"finish");
[activity hide:YES];
NSString *app;
if (currentPage == 3)
app=@"<style>table {font-size:10px;}</style>";
else app=@"<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;
}