- (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation{
NSString *htmlString = @"document.documentElement.innerHTML";//获取当前网页的html
[webView evaluateJavaScript: htmlString completionHandler:^(id result, NSError *error){
}];
}
// thisURL = document.URL;
// thisHREF = document.location.href;
// thisSLoc = self.location.href;
// thisDLoc = document.location;
// thisTLoc = top.location.href;
// thisPLoc = parent.document.location;
// thisTHost = top.location.hostname;
// thisHost = location.hostname;
// thisTitle = document.title;
// thisProtocol = document.location.protocol;
// thisPort = document.location.port;
// thisHash = document.location.hash;
// thisSearch = document.location.search;
// thisPathname = document.location.pathname;
// thisHtml = document.documentElement.innerHTML;
// thisBodyText = document.documentElement.innerText;//获取网页内容文字
// thisBodyText = document.body.innerText;//获取网页内容文字 怎么和上一个一样