UIWebView通过JS语句获取网页(html)的某些数值
//To get string from the title of the HTML page:
NSString *currentURL = [theWebView stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('title')[0][removed];"];
//To get string from class name:
NSString *someHTML = [theWebView stringByEvaluatingJavaScriptFromString:@"document.getElementsByClassName('class name')[0][removed];"];
//To get string from element id:
NSString *html = [theWebView stringByEvaluatingJavaScriptFromString:@"document.getElementById('div id').textContent=''"];
UIWebView通过JS语句获取网页(html)的某些数值的更多相关文章
- JS远程获取网页源代码的例子
		js代码获取网页源代码. 代码: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> < ... 
- UIWebView执行JS语句
		示例网页: http://m.dianping.com/tuan/deal/moreinfo/11507109 移除该网页的返回按钮, 购买链接, 最底部的友情链接 代码: NSMutableStri ... 
- Js/Jquery获取网页屏幕可见区域高度
		获取浏览器窗口的可视区域高度和宽度,滚动条高度有需要的朋友可参考一下. 1 document.body.clientWidth ==> BODY对象宽度 2 document.body.clie ... 
- js jq 获取网页元素宽度
		Javascript: IE中:document.body.clientWidth ==> BODY对象宽度document.body.clientHeight ==> BODY对象高度d ... 
- xml文件里  用js语句获取 当前时间
		获取当前时间的代码:xml文件中 <td><div align="center"><br/><strong>送检时间</str ... 
- 获取网页URL地址及参数等的两种方法(js和C#)
		转:获取网页URL地址及参数等的两种方法(js和C#) 一 js 先看一个示例 用javascript获取url网址信息 <script type="text/javascript&q ... 
- JS获取网页属性包括宽、高等
		JS获取网页属性包括宽.高等. function getInfo() { // www.jbxue.com var s = ""; s += " 网页可见区域宽:&q ... 
- JS获取网页宽高方法集合
		JS获取网页宽高等方法的集合:document.body.clientWidth - 网页可见区域宽document.body.clientHeight - 网页可见区域高 document.body ... 
- js技术要点---JS 获取网页源代码
		JS 获取网页源代码 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html& ... 
随机推荐
- 【BZOJ】2157: 旅游
			http://www.lydsy.com/JudgeOnline/problem.php?id=2157 题解:裸lct不解释.. #include <bits/stdc++.h> usi ... 
- CF 7C. Line(扩展欧几里德)
			题目链接 AC了.经典问题,a*x+b*y+c = 0整数点,有些忘记了扩展欧几里德,复习一下. #include <cstdio> #include <iostream> # ... 
- HDU 4738 Caocao's Bridges(Tarjan)
			题目链接 #include <iostream> #include <cstring> #include <cstdio> #include <queue&g ... 
- My Notepad
			I have spent near more two weeks to write this Notepad application. At this moment, I want to share ... 
- base64编解码实现
			#include <stdio.h> #include <stdlib.h> #include <limits.h> #include <string.h&g ... 
- XCode编译文件过多导致内存吃紧解决方法
			XCode编译文件过多导致内存吃紧解决方法 /Users/~~/Library/Developer/Xcode/DerivedData 1) 然后 找到编译文件 删除 就好了哦 快去试试看吧 
- U-Boot命令大全(功能参数及用法)
			U-Boot上电启动后,按任意键可以退出自动启动状态,进入命令行. U-Boot 2010.03 (Sep 25 2011 - 16:18:50) DRAM: 64 MB Flash: ... 
- 找到一个Flex中LineChart很好的学习博客
			http://blog.flexexamples.com/category/linechart/ 里面链接复制的时候失效了,请直接点击原页面进行查看 Setting specific minimum ... 
- [CareerCup] 18.12 Largest Sum Submatrix 和最大的子矩阵
			18.12 Given an NxN matrix of positive and negative integers, write code to find the submatrix with t ... 
- XML 中对当前时间的引用
			current_date 而不是 date 然而,在attrs 和 readonly中并不适用. 
