[IOS开发]获取webView中网页…
来源:互联网 发布:错生网络剧第一集 编辑:程序博客网 时间:2024/06/05 05:20
原文地址:[IOS开发]获取webView中网页的信息作者:超人
获取所有html:NSString *lJs =@"document.documentElement.innerHTML";
获取网页title:NSString *lJs2 =@"document.title";
UIWebView*lWebView = [self getCurrentWebView];
NSString*lHtml1 = [lWebViewstringByEvaluatingJavaScriptFromString:lJs];
NSString*lHtml2 = [lWebViewstringByEvaluatingJavaScriptFromString: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;//获取网页内容文字
thisBodyText =document.body.innerText;//获取网页内容文字怎么和上一个一样?有知道的请解释
获取网页title:NSString *lJs2 =@"document.title";
UIWebView*lWebView = [self getCurrentWebView];
NSString*lHtml1 = [lWebViewstringByEvaluatingJavaSc
NSString*lHtml2 = [lWebViewstringByEvaluatingJavaSc
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;//获取网页内容文字
thisBodyText =document.body.innerText;//获取网页内容文字
0 0
- [IOS开发]获取webView中网页…
- [IOS开发]获取webView中网页…
- IOS开发获取webView中网页的信息
- iOS开发获取webview中网页的信息
- [IOS开发]获取webView中网页的信息
- Android:在WebView中获取网页源码
- Android:在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- 在webview中获取网页源码
- Android: 在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- Android: 在WebView中获取网页源码
- Android 在WebView中获取网页源码
- 在WebView中获取网页中的内容
- 1、使用Xcode修改iOS项目工…
- ios判断手机号码
- iOS手势识别的详细使用(拖动,缩放,…
- ios 查询文件夹大小
- IOS中的WebView
- [IOS开发]获取webView中网页…
- RHEL 6 安装 JDK 6U45 (rmp方式)
- 自定义UIBarButtonItem
- iOS开发常用国外网站清单
- iOS官方参考文档
- App Store 审核指南
- ios ipa文件反编译
- IOS应用内购买
- The Triangle 经典DP