[ios]iphone 获取UIWebView内Html方法
来源:互联网 发布:四川网络作家协会官网 编辑:程序博客网 时间:2024/05/20 18:46
原文:http://blog.csdn.net/diyagoanyhacker/article/details/6564897
获取所有html:NSString *lJs = @"document.documentElement.innerHTML";
获取网页title:NSString *lJs2 = @"document.title";
UIWebView *lWebView = [self getCurrentWebView];
NSString *lHtml1 = [lWebView stringByEvaluatingJavaScriptFromString:lJs];
NSString *lHtml2 = [lWebView stringByEvaluatingJavaScriptFromString:lJs2];
获取网页title:NSString *lJs2 = @"document.title";
UIWebView *lWebView = [self getCurrentWebView];
NSString *lHtml1 = [lWebView stringByEvaluatingJavaScriptFromString:lJs];
NSString *lHtml2 = [lWebView stringByEvaluatingJavaScriptFromString:lJs2];
JavaScript获取网页信息总结
JavaScript获取当前页面URL、title等,具体怎么用就看自己了~
由于本站用了伪静态,所以获取不到文档名.document.location.port;是获取URL关联的端口号码,thisHash = document.location.hash;是获取链接属性中在井号“#”后面的分段。
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;//获取网页内容文字
由于本站用了伪静态,所以获取不到文档名.document.location.port;是获取URL关联的端口号码,thisHash = document.location.hash;是获取链接属性中在井号“#”后面的分段。
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;//获取网页内容文字
0 0
- [ios]iphone 获取UIWebView内Html方法
- iphone 获取UIWebView内Html方法
- iphone 获取UIWebView内Html方法
- iphone 获取UIWebView内Html方法
- iphone 获取UIWebView内Html方法
- iphone 获取UIWebView内Html方法
- iPhone中获取UIWebView内的html方法
- 获取UIWebView内Html方法
- 获取UIWebView内Html方法
- Iphone UiWebView中HTML获取之Javascript
- IOS 实时获取UIWebView中的html内容
- iPhone开发--实时获取UIWebView中的html内容
- iOS Swift3.0 UIWebView获取HTML(title,url,body...) stringByEvaluatingJavaScript
- iOS UIWebView 获取Url
- iOS UIWebView 代理方法
- UIWebView加载本地html ios
- ios UIWebView 显示html文本
- iOS UIWebView加载html代码
- [ios2]25个增强iOS应用程序性能的提示和技巧 【转】
- [设计]八个移动产品设计必备网站
- [ios2]警告:Block的Retain Cycle的解决方法 【转】
- [ios2]如何让IOS应用从容地崩溃 【转】
- [ios2] iOS常用控件尺寸大集合 【转】
- [ios]iphone 获取UIWebView内Html方法
- [ios2]iOS 图片与内存 【转】
- [资源]鸟哥的Linux私房菜
- [ios2]使用NSOperationQueue简化多线程开发和队列的优先级 【转】
- [ios2]iOS 使用subversion管理iOS源代码 【转】
- [ios2]苹果iOS 5限制应用本地存储问题 【转】
- [ios2][转]iOS摇动检测 (UIAccelerometer)
- [ios2] CABasicAnimation【转】
- [ios2] ios使用自带git respository管理项目 【转】