This article reprinted to 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"];//gets the title of the current page
Self.currenturl = webView.request.URL.absoluteString;
NSLog (@ "title-%@--url-%@--", Self.title,self.currenturl);
NSString *ljs = @ "Document.documentElement.innerHTML";//gets the HTML of the current page
self.currenthtml = [WebView Stringbyevaluatingjavascriptfromstring:ljs];
}
ios-gets the URL and title and HTML for the current page