@property (strong,nonatomic)UIWebView *webView;  

@property (strong,nonatomic)NSString *currentURL;  

@property (strong,nonatomic)NSString *currentTitle;  

@property (strong,nonatomic)NSString *currentHTML;  

-(void) webViewDidFinishLoad:(UIWebView *)webView {  

  

    [UIApplicationsharedApplication].networkActivityIndicatorVisible =NO;  

    self.title =  [webViewstringByEvaluatingJavaScriptFromString:@"document.title"];//获取当前页面的title  

      

   self.currentURL = webView.request.URL.absoluteString;  

    NSLog(@"title-%@--url-%@--",self.title,self.currentURL);  

  

   NSString *lJs = @"document.documentElement.innerHTML";//获取当前html  

   self.currentHTML = [webView stringByEvaluatingJavaScriptFromString:lJs];  

      

}  

相关文章:

  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-02-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案