美文网首页
获取webView中网页的内容

获取webView中网页的内容

作者: 飘摇的水草 | 来源:发表于2017-05-12 18:37 被阅读288次
  刚刚研究了一下用UIWebView获取网页内容的方式,特此记录一下:

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;//获取网页内容文字

相关文章

网友评论

      本文标题:获取webView中网页的内容

      本文链接:https://www.haomeiwen.com/subject/ouktxxtx.html