iOS-获取当前网页的 url 和 title 和 html
2015-03-03 17:21
411 查看
本文转载至 http://www.th7.cn/Program/IOS/201310/156916.shtml
@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];
}
相关文章推荐
- iOS-获取当前网页的 url 和 title 和 html
- ios webview 获取 网页的URL、title和HTML
- iOS 获取当前网页html
- iOS-获取webview的 url 和 title 和 html
- iOS-获取webview的 url 和 title 和 html
- Swift UIWebView获取当前网页的Url和title
- ios stringWithContentsOfURL 获取网页html中json
- iOS Swift3.0 UIWebView获取HTML(title,url,body...) stringByEvaluatingJavaScript
- iOS ios与js交互,获取webview完整url,title,获取元素并赋值跳转
- UIWebView获取正在加载的URL和网页title
- UIWebView获取正在加载的URL和网页title
- ios与js交互,获取webview完整url,title,获取元素并赋值跳转
- iOS项目开发实战——iOS网络编程获取网页Html源代码
- 获取当前网页的的url
- html页面中js获取当前url下指定参数的值
- 如何获取WebView的url和title和html
- 获取HTML网页的所有图片的url
- ios 根据url获取html,并解析
- iOS项目开发实战——使用异步请求获取网页HTML源代码
- .net 获取当前网页的的url