wk通过js获取id,动态注入js删除相应元素

- (void)webView:(WKWebView *)webView didFinishNavigation:(null_unspecified WKNavigation *)navigation{
    NSString *str = @"var elem = document.getElementById('getStarted');elem.parentNode.removeChild(elem);";
        [webView evaluateJavaScript:str completionHandler:nil];
    
}

你可能感兴趣的:(wk通过js获取id,动态注入js删除相应元素)