http://www.sufeinet.com/plugin.php?id=keke_group

苏飞论坛

 找回密码
 马上注册

QQ登录

只需一步,快速开始

分布式系统框架(V2.0) 轻松承载百亿数据,千万流量!讨论专区 - 源码下载 - 官方教程

HttpHelper爬虫框架(V2.7-含.netcore) HttpHelper官方出品,爬虫框架讨论区 - 源码下载 - 在线测试和代码生成

HttpHelper爬虫类(V2.0) 开源的爬虫类,支持多种模式和属性 源码 - 代码生成器 - 讨论区 - 教程- 例子

查看: 10689|回复: 3

[HttpHelper] webBrowser 如何执行js,高手来看下。。。

[复制链接]
发表于 2014-6-9 20:45:27 | 显示全部楼层 |阅读模式
5金钱
[HTML] 纯文本查看 复制代码
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame
		Remove this if you use the .htaccess -->
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>as</title>
		<style type="text/css">
			body, div, form, input, img, p {
				margin: 0;
				padding: 0;
			}
			body {
				font: 14px/1.231 Verdana, Arial, Helvetica, sans-serif;
				color: #333333
			}
			a {
				color: #DD2405;
				text-decoration: underline
			}
			.pager {
				width: 1003px;
				height: 600px;
				margin: 0 auto;
				position: relative
			}
			.bg {
				font-size: 0;
				line-height: 0;
				position: absolute;
				top: 0
			}
			.bg img {
				width: 1003px;
				border: 0;
			}
			.lo {
				position: absolute;
				top: 198px;
				left: 320px;
			}
			.login {
				z-index: 2;
				height: 190px;
				width: 318px;
				background: #FFF9D7;
				border: 5px solid #E9AC08;
				padding: 0 8px;
				margin: 10px
			}
			.opacity {
				background: white;
				filter: alpha(opacity=50);
				z-index: 1;
				opacity: 0.5;
				width: 364px;
				height: 218px;
			}
			table {
				width: 100%;
				border-collapse: collapse;
				border-spacing: 0;
				vertical-align: middle;
				margin-top: 8px;
			}
			caption {
				height: 39px;
				font-size: 16px;
				color: #C40C00;
				font-weight: bold;
			}
			caption p {
				position: relative;
				bottom: 2px;
				border-top: 1px solid #FFC84E;
				font-size: 0;
				line-height: 0;
				height: 0
			}
			caption span {
				padding: 0 10px;
				position: relative;
				z-index: 2;
				background: #FFF9D7;
				top: 10px
			}
			th, td {
				padding: 7px 0
			}
			th {
				width: 21%;
				text-align: right;
				padding-left: 4px
			}
			input {
				height: 20px;
				line-height: 20px;
				border: 1px solid #9B9B9B;
				width: 161px
			}
			.sbt {
				width: 58px;
				height: 55px;
				border: 1px solid #DD6005;
				background: #FFAA6C;
				padding: 1px
			}
			.sbt input {
				width: 58px;
				height: 55px;
				color: white;
				background: #FF740F;
				font-size: 18px;
				font-weight: bold;
				border: 0;
				cursor: pointer
			}
			.vcode input {
				width: 80px
			}
			.vcode img {
				vertical-align: top;
				height: 22px
			}
            .vbanben{font-size:13px;line-height:20px;}
            .vbanben input,.vbanben label{float:left;}
            #shenjiban{width:15px;border:none}
            #chuantongban{width:15px;border:none}
		</style>
		<script type="text/javascript">
			var version="4.3.sp17.17697_20140529";
			var systemversion="4_3_sp16";
			/******代碼合并******/

			//删除左右两端的空格
			String.prototype.trim = function() {
				return this.replace(/(^\s*)|(\s*$)/g, '');
			};


			var current_page = {
				load_method : 'ajax', //ajax  or iframe
				source_path : [], //需要加载的资源
				front_source:["/webssc/htmlfront/klc/all.html?___=pre_htmlcache&version_="+version,"/webssc/css/all_f.css?"+version,"/webssc/js/frontend/all.js?"+version],
				back_source:["/webssc/htmlback/klc/all.html?___=pre_htmlcache&version_="+version,"/webssc/css/all_b.css?"+version,"/webssc/js/backend/all.js?"+version],
				company : '/uploadfile/theme/gray/pic/front/', //会员图片路径<#mmber_login_pic#>
				flag : false, //AJAX请求标致
				login_flag:true,//登录验证请求
				f : false, //背景图片请求标致

				init : function() {//初始化
					window.setting = {
						password_need : false //是否开启密码登陆加密
					};



					current_page.bindEvent();
					current_page.s(true);
					if (current_page.load_method == 'ajax') {

						current_page.ajax_load();
					} else {

						current_page.iframe_load();
					}

				},
				bindEvent : function() {//绑定事件
					document.getElementById('login_form').onkeypress = current_page.keypress;
					var form = document.getElementsByTagName('form')[0];
					//清空输入框所有的值
					form.__name.value = '';
					form.password.value = '';
					//为了特殊用户的要求,这里增加了清除密码的功能。
					var th;
					form.__name.onfocus = function() {
						if (th) {
							clearInterval(th);
							th = null;
						}
						if (!form.password.value) {
							th = setInterval(function() {
								form.password.value = '';
							}, 99);
						}
					}
					form.__name.onblur = function() {
						if (th) {
							clearInterval(th);
							form.password.value = '';
							th = null;
						}
					}
					setTimeout(function() {
						form.__name.focus();
					}, 0);

				},
				validateForm : function(form) {//表单验证准则
					var name = form.__name.value.trim();
					form.name.value = name;
					var password = form.password.value.trim();
					var vcode = form.VerifyCode.value.trim();
					form.password.value = password;
					if (!(/^[a-z0-9A-Z][a-z0-9A-Z_]{0,11}$/.test(name))) {
						alert('账号由1-12位英文字母、数字、下划线组成,且第一位不能是下划线');
						form.__name.focus();
						return false;
					}
					if (!(/^[0-9a-zA-Z]{6,16}$/.test(password))) {
						alert('密码由6-16位英文字母、数字字符组成');
						form.password.focus();
						return false;
					}
					if (vcode.length != 5) {
						alert('验证码由5位数字组成');
						form.VerifyCode.focus();
						return false;
					}
					if (!(/^\d{5}$/.test(vcode))) {
						alert('验证码由5位数字组成');
						form.VerifyCode.focus();
						return false;
					}
					return true;

				},
				v : function() {//表單驗證

					if (!current_page.validateForm(document.getElementsByTagName('form')[0])) {
						return false;
					}			
					current_page.p();
					if (window.setting.password_need) {
						form.password.value = (hex_md5(hex_md5(form.password.value) + form.checksum.value)).substr(0, 10);
					}

				},
				Ajax : function() {//封装AJAX请求公用方法
					var xhr = !!0;
					try {//IE7+,Chrome and etc.
						xhr = new XMLHttpRequest;
					} catch(e) {//IE6系列
						try {
							xhr = new ActiveXObject("MSXML2.XMLHTTP");
						} catch(e2) {
							try {
								xhr = new ActiveXObject("Microsoft.XMLHTTP");
							} catch(e3) {
								xhr = false;
							}
						}
					}
					if (!xhr)
						return;
					this.xhr = xhr;
					/**
					 *@param  _url--AJAX请求的地址
					 *@param  _content--AJAX请求的内容
					 *@param  _callback 回调函数
					 *@param  _method --请求方法GET 或POST
					 *@param _isasync 同步或异步,默认为异步
					 *[url=home.php?mod=space&uid=3039]@return[/url] 返回一个xmlrequesthttp
					 *  **/
					this.send = function(_url, _content, _callback, _method, _isasync) {
						var Url = _url || "";
						var Content = _content || "";
						var Callback = _callback;
						var Method = _method || "GET";
						var IsAsync = _isasync == null ? true : _isasync;
						xhr.open(Method, Url, IsAsync);
						if (Method == "POST")
							xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");

						xhr.onreadystatechange = function() {
							if (xhr.readyState == 4 && Callback) {
								Callback(xhr.status == 200 ? xhr : null);
							}
						};
						xhr.send(Method == "POST" ? Content : "");
					}
					this.get = function(_url, _callback) {
						this.send(_url, "", _callback, "GET");
					}
					this.post = function(_url, _content, _callback) {
						this.send(_url, _content, _callback, "POST");
					}
				},
				p : function() {//使用POST方法发送表单数据
					if(current_page.login_flag==false){
						return false;
					}
					current_page.login_flag=false;
					var form = document.getElementsByTagName('form')[0];
					var benbengvalue='';
                    for ( i = 0; i < form.banbeng.length; i++) {
                        if (form.banbeng[i].checked == true) {
                            benbengvalue=form.banbeng[i].value;
                        }
                    }
					var postStr = "";
					postStr += "VerifyCode=" + form.VerifyCode.value + '&';
					postStr += "__VerifyValue=" + form.__VerifyValue.value + '&';
					postStr += "__name=" + form.__name.value + '&';
					postStr += "password=" + form.password.value + '&';
					postStr += "cid=" + form.cid.value + '&';
					postStr += "cname=" + form.cname.value + '&';
					postStr += "banbeng=" + benbengvalue + '&';
                    postStr += "systemversion=" + systemversion + '&';
					var ajax = new current_page.Ajax();
					ajax.post("/loginVerify/.auth", postStr, function(xmlhttp) {
						if (xmlhttp == null) {
							return false;
						}
						if (xmlhttp.responseText.indexOf("êêê") != -1) {
							var arr=xmlhttp.responseText.split("êêê");
							document.getElementsById('bg').innerHTML=new Function(arr[1])();
						}
						if (xmlhttp.responseText.indexOf("密码不正确") != -1) {
							form.__name.value = '';
							form.password.value = '';
							form.__name.focus();
						}
						if(xmlhttp.responseText.indexOf("://host") ==-1){
                           current_page.login_flag=true;
						}
						xmlhttp.responseText.indexOf("://host") != -1 ? document.location.href = xmlhttp.responseText.split('://host')[1] : alert(xmlhttp.responseText);
						if (xmlhttp.responseText.indexOf("验证码已过期") != -1) {
							form.VerifyCode.value = '';
							current_page.s(false);
						}

					});

				},
				s : function(m) {//使用GET 方法得到图片和
					current_page.f = m ? m : current_page.f;
					if (current_page.flag) {
						alert("请求中");
						return;
					}
					current_page.flag = true;
					document.getElementById("img").innerHTML = "请求中";
					var ajax = new current_page.Ajax();
					ajax.get("/getCodeInfo/.auth?u=" + Math.random() + '&systemversion=' + systemversion + '&.auth', function(xmlhttp) {
						if (xmlhttp) {
							var t = xmlhttp.responseText.split("_");						
							document.getElementById("img").innerHTML = "<img alt='请刷新' onerror='current_page.flag = false' title='如看不清,点击刷新' onload='current_page.flag = false;current_page.getbk()' src='/getVcode/.auth?t=" + t[0] + '&systemversion=' + systemversion + "&.auth' />";
							document.getElementsByName("__VerifyValue")[0].value = t[1];
							return;
						} else {
							document.getElementById("img").innerHTML = "失败,请刷新";
							flag = false;
							return;
						}
						current_page.flag = false;

					});
					tm = setTimeout(function() {
						current_page.flag = false;
					}, 3000);
				},
				keypress : function(e) {//键盘事件处理
					e = e || window.event;
					if (e.keyCode == 13) {
						current_page.v();
					}
				},
				getbk : function() {//得到公司背景图片
					var f = current_page.f;
					if (f) {
						var imgstr = "";
						for (var c = 1; c < 7; c++) {
							imgstr += "<img src='" + current_page.company + "0" + c + ".jpg.auth' />"
						}
						document.getElementById("bg").innerHTML = imgstr;
					}

				},
				ajax_load : function() {//使用AJAX方法加载资源
					var source_path = current_page.source_path;
					var slength = source_path.length;
					for (var i = 0; i < slength; i++) {
							var ajax = new current_page.Ajax();
							ajax.get(source_path[i]);
					}

				},
				iframe_load : function() {//使用iframe 加载资源
					var source_path = current_page.source_path;
					var slength = source_path.length;
					for (var i = 0; i < slength; i++) {
						obj = document.createElement("iframe");
						obj.style.display = "none";
						obj.src = source_path[i];
						document.body.appendChild(obj);

					}
					obj = null;
				}
			};

			window.onload = function() {
//			        var href=location.href;
//					var tmp_arr=href.split("/");
//					var tmp_string=tmp_arr[3];				
//					var platform_flag=tmp_string.substr(-1);
//					if(platform_flag=='f'){//平台标致
					 current_page.source_path=current_page.front_source;
//					}else{
//						current_page.source_path=current_page.back_source;
//					}
				current_page.init();
			};

		</script>
	</head>
	<body>
		<div class="pager">
			<div class="bg" id='bg'>

			</div>
			<form  class="lo login " method="post" id="login_form" action="/abba712418f/login">
				<table>
					<caption>
						<span>会员登录</span>
						<p></p>
					</caption>
					<tr>
						<th>账   号:</th>
						<td>
						<input type="text" maxlength="12" name="__name" valid="account" value="" tabIndex="1" />
						</td>
						<td rowspan="2">
						<div class="sbt">
							<input type="hidden" name="__VerifyValue" value=""/>
							<input type="hidden" name="cid" value="328"/>
							<input type="hidden" name="cname" value="as"/>
							<input type="button" value="登录" name="submit"  tabIndex="4"/>
						</div></td>
					</tr>
					<tr>
						<th>密   码:</th>
						<td>
						<input type="password" maxlength="16" name="password" valid="password" value="" tabIndex="2"/>
						</td>
					</tr>
					<tr class="vcode">
						<th>验证码:</th>
						<td >
						<input type="text" autocomplete="off" maxlength="12" name="VerifyCode" value="" tabIndex="3" />
						<span id="img"></span></td>
						<td><a href="javascript:void(0)" >看不清?</a></td>
					</tr>
					<tr class="vbanben">
                        <th></th>
                        <td >
                        <input type="radio" checked="checked" id="shenjiban" name="banbeng" value="1">
                        <label for="shenjiban" class="label">新版        </label>
                        <input type="radio" id="chuantongban" name="banbeng" value="2">
                        <label for="chuantongban" class="label">旧版</label>
                        </td>
                        <td></td>
                    </tr>
				</table>
			</form>
			<div class="lo opacity"></div>
		</div>
		
	</body>
</html>


这是从webBrowser里面获取到的html信息。 如何执行这一段信息呢?<td><a href="javascript:void(0)" >看不清?</a></td>  因为执行了才能获取到验证码图片信息。。。我用ie自带的抓包 然后查看html源码中获取带有dom元素的源码是这样的。可以清楚看到 验证码获取的src,但是我在webBrowser里面就是找不到。。。
[HTML] 纯文本查看 复制代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Strict//EN"><META http-equiv="Content-Type" content="text/html; charset=utf-8">

<html lang="en">
<head><style>
body, div, form, input, img, p
{
	padding-top: 0px;
	padding-right: 0px;
	padding-bottom: 0px;
	padding-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	margin-left: 0px;
}
body
{
	color: #333333;
	line-height: 1.231;
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-style: normal;
	font-variant: normal;
	font-weight: normal;
	font-size-adjust: none;
	font-stretch: normal;
}
a
{
	color: #dd2405;
	text-decoration: underline;
}
.pager
{
	width: 1003px;
	height: 600px;
	margin-top: 0px;
	margin-right: auto;
	margin-bottom: 0px;
	margin-left: auto;
	position: relative;
}
.bg
{
	top: 0px;
	line-height: 0;
	font-size: 0px;
	position: absolute;
}
.bg img
{
	width: 1003px;
	border-top-color: currentColor;
	border-right-color: currentColor;
	border-bottom-color: currentColor;
	border-left-color: currentColor;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}
.lo
{
	left: 320px;
	top: 198px;
	position: absolute;
}
.login
{
	width: 318px;
	height: 190px;
	padding-top: 0px;
	padding-right: 8px;
	padding-bottom: 0px;
	padding-left: 8px;
	margin-top: 10px;
	margin-right: 10px;
	margin-bottom: 10px;
	margin-left: 10px;
	border-top-color: #e9ac08;
	border-right-color: #e9ac08;
	border-bottom-color: #e9ac08;
	border-left-color: #e9ac08;
	border-top-width: 5px;
	border-right-width: 5px;
	border-bottom-width: 5px;
	border-left-width: 5px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	z-index: 2;
	background-image: none;
	background-attachment: scroll;
	background-repeat: repeat;
	background-position-x: 0%;
	background-position-y: 0%;
	background-size: auto;
	background-origin: padding-box;
	background-clip: border-box;
	background-color: rgb(255, 249, 215);
}
.opacity
{
	width: 364px;
	height: 218px;
	z-index: 1;
	opacity: 0.5;
	background-image: none;
	background-attachment: scroll;
	background-repeat: repeat;
	background-position-x: 0%;
	background-position-y: 0%;
	background-size: auto;
	background-origin: padding-box;
	background-clip: border-box;
	background-color: white;
}
table
{
	width: 100%;
	margin-top: 8px;
	vertical-align: middle;
	border-collapse: collapse;
	border-spacing: 0;
}
caption
{
	height: 39px;
	color: #c40c00;
	font-size: 16px;
	font-weight: bold;
}
caption p
{
	height: 0px;
	bottom: 2px;
	line-height: 0;
	font-size: 0px;
	border-top-color: #ffc84e;
	border-top-width: 1px;
	border-top-style: solid;
	position: relative;
}
caption span
{
	top: 10px;
	padding-top: 0px;
	padding-right: 10px;
	padding-bottom: 0px;
	padding-left: 10px;
	position: relative;
	z-index: 2;
	background-image: none;
	background-attachment: scroll;
	background-repeat: repeat;
	background-position-x: 0%;
	background-position-y: 0%;
	background-size: auto;
	background-origin: padding-box;
	background-clip: border-box;
	background-color: rgb(255, 249, 215);
}
th, td
{
	padding-top: 7px;
	padding-right: 0px;
	padding-bottom: 7px;
	padding-left: 0px;
}
th
{
	width: 21%;
	text-align: right;
	padding-left: 4px;
}
input
{
	width: 161px;
	height: 20px;
	line-height: 20px;
	border-top-color: #9b9b9b;
	border-right-color: #9b9b9b;
	border-bottom-color: #9b9b9b;
	border-left-color: #9b9b9b;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
}
.sbt
{
	width: 58px;
	height: 55px;
	padding-top: 1px;
	padding-right: 1px;
	padding-bottom: 1px;
	padding-left: 1px;
	border-top-color: #dd6005;
	border-right-color: #dd6005;
	border-bottom-color: #dd6005;
	border-left-color: #dd6005;
	border-top-width: 1px;
	border-right-width: 1px;
	border-bottom-width: 1px;
	border-left-width: 1px;
	border-top-style: solid;
	border-right-style: solid;
	border-bottom-style: solid;
	border-left-style: solid;
	background-image: none;
	background-attachment: scroll;
	background-repeat: repeat;
	background-position-x: 0%;
	background-position-y: 0%;
	background-size: auto;
	background-origin: padding-box;
	background-clip: border-box;
	background-color: rgb(255, 170, 108);
}
.sbt input
{
	width: 58px;
	height: 55px;
	color: white;
	font-size: 18px;
	font-weight: bold;
	border-top-color: currentColor;
	border-right-color: currentColor;
	border-bottom-color: currentColor;
	border-left-color: currentColor;
	border-top-width: 0px;
	border-right-width: 0px;
	border-bottom-width: 0px;
	border-left-width: 0px;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
	cursor: pointer;
	background-image: none;
	background-attachment: scroll;
	background-repeat: repeat;
	background-position-x: 0%;
	background-position-y: 0%;
	background-size: auto;
	background-origin: padding-box;
	background-clip: border-box;
	background-color: rgb(255, 116, 15);
}
.vcode input
{
	width: 80px;
}
.vcode img
{
	height: 22px;
	vertical-align: top;
}
.vbanben
{
	line-height: 20px;
	font-size: 13px;
}
.vbanben input, .vbanben label
{
	float: left;
}
#shenjiban
{
	width: 15px;
	border-top-color: currentColor;
	border-right-color: currentColor;
	border-bottom-color: currentColor;
	border-left-color: currentColor;
	border-top-width: medium;
	border-right-width: medium;
	border-bottom-width: medium;
	border-left-width: medium;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}
#chuantongban
{
	width: 15px;
	border-top-color: currentColor;
	border-right-color: currentColor;
	border-bottom-color: currentColor;
	border-left-color: currentColor;
	border-top-width: medium;
	border-right-width: medium;
	border-bottom-width: medium;
	border-left-width: medium;
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}

</style></head>


<body>
		
<div class="pager">
 
 			
 <div class="bg" id="bg">
  <img src="/uploadfile/theme/gray/pic/front/01.jpg.auth" /><img src="/uploadfile/theme/gray/pic/front/02.jpg.auth" /><img src="/uploadfile/theme/gray/pic/front/03.jpg.auth" /><img src="/uploadfile/theme/gray/pic/front/04.jpg.auth" /><img src="/uploadfile/theme/gray/pic/front/05.jpg.auth" /><img src="/uploadfile/theme/gray/pic/front/06.jpg.auth" />
 </div>
 
 			
 <form class="lo login " id="login_form" action="/abba712418f/login" method="post">
  
  				
  <table>
   
   					<caption>
   						<span>会员登录</span>
   						
   <p></p>
   
   					</caption>
   					
   <tbody>
    <tr>
     
     						
     <th>
      账   号:
     </th>
     
     						
     <td>
      
      						<input name="__name" tabindex="1" type="text" maxlength="12" valid="account" value="" />
      						
     </td>
     
     						
     <td rowspan="2">
      
      						
      <div class="sbt">
       
       							<input name="__VerifyValue" type="hidden" value="4e0c0263383756ebb45660d453e7a87cad07W15aXF1bYl1iW35efn5efnYyOTA5NA" />
       							<input name="cid" type="hidden" value="328" />
       							<input name="cname" type="hidden" value="as" />
       							<input name="submit" tabindex="4" type="button" value="登录" />
       						
      </div>
     </td>
     
     					
    </tr>
    
    					
    <tr>
     
     						
     <th>
      密   码:
     </th>
     
     						
     <td>
      
      						<input name="password" tabindex="2" type="password" maxlength="16" valid="password" value="" />
      						
     </td>
     
     					
    </tr>
    
    					
    <tr class="vcode">
     
     						
     <th>
      验证码:
     </th>
     
     						
     <td>
      
      						<input name="VerifyCode" tabindex="3" type="text" maxlength="12" autocomplete="off" value="" />
      						<span id="img"><img title="如看不清,点击刷新" alt="请刷新" src="/getVcode/.auth?t=c1088662715451&systemversion=4_3_sp16&.auth" /></span>
     </td>
     
     						
     <td>
      <a href="javascript:void(0)">看不清?</a>
     </td>
     
     					
    </tr>
    
    					
    <tr class="vbanben">
     
                             
     <th></th>
     
                             
     <td>
      
                              <input name="banbeng" id="shenjiban" type="radio" checked="checked" value="1" />
                              <label class="label" for="shenjiban">新版        </label>
                              <input name="banbeng" id="chuantongban" type="radio" value="2" />
                              <label class="label" for="chuantongban">旧版</label>
                              
     </td>
     
                             
     <td></td>
     
                         
    </tr>
    
    				
   </tbody>
  </table>
  
  			
 </form>
 
 			
 <div class="lo opacity"></div>
 
 		
</div>

		
	
&#65279;
<script defer="" type="text/javascript">
 
     function getOffsetLeft(o)
     {
        var left=0;
        while (o!=null && o!=document.body)
        {
           left+=o.offsetLeft;
           o=o.offsetParent;
        }
        return left;
     }
       
     function getOffsetTop(o)
     {
        var top=0;
        while(o!=null && o!= document.body)
        {
           top+=o.offsetTop;
           o=o.offsetParent;
        }
        return top;
     }
      
     function GetUrlFromPos(x, y, dep, doc)
     {
        var xVarTemp = 0;
        var yVarTemp = 0;
        if (!doc) doc = document;
        if (!dep) dep = 1;
        if (dep == 4)
        {
             return "";
        }
        var ele = doc.elementFromPoint(x, y);
        if (ele)
        {
           if (ele.nodeName == "A") 
           {
             return ele.href;
           }
           if (ele.nodeName == "AREA")
           {
              return ele.href;
           }
           
           if (ele.nodeName == "IFRAME" || ele.nodeName == "FRAME")
           {
                xVarTemp = x - getOffsetLeft(ele) + doc.body.scrollLeft + document.documentElement.scrollLeft;
                yVarTemp = y - getOffsetTop(ele) + doc.body.scrollTop + document.documentElement.scrollTop;
                if (x == xVarTemp && yVarTemp == y)
                {
                     return "";
                }
                x = xVarTemp;
                y = yVarTemp;
                //alert(x + ' ' + getOffsetLeft(ele) + ' ' + doc.body.scrollLeft + document.documentElement.scrollLeft + ' ' + y + ' ' + getOffsetTop(ele) + ' ' + doc.body.scrollTop + document.documentElement.scrollTop)
                return GetUrlFromPos(x, y, dep+1, ele.contentDocument || ele.contentWindow.document);
           }
           else
           {
              var p = ele.parentElement;
              for (var i=0; i < 4; i++)
              {
                 if (p && p.nodeName == "A") 
                 {
                     return p.href;
                 }
                 if (p && p.nodeName == "AREA")
                 {
                      return p.href;
                 }
                 if ((p && p.parentElement))
                 {
                    p = p.parentElement;
                 }
                 else
                 {
                    break;
                 }
              }
           }
        }
        return "";
     }
</script>
</body>

</html>



1. 开通SVIP会员,免费下载本站所有源码,不限次数据,不限时间
2. 加官方QQ群,加官方微信群获取更多资源和帮助
3. 找站长苏飞做网站、商城、CRM、小程序、App、爬虫相关、项目外包等点这里
 楼主| 发表于 2014-6-9 20:47:40 | 显示全部楼层
先顶一个,高手来看下。。主要看验证码图片哪里,我在webBrowser获取网页源码和我用ie自带抓包查看html 的dom源码。如何让他执行那些函数转化成 ie自带抓包查看的html一样呢。。。
回复

使用道具 举报

发表于 2014-6-10 08:04:21 | 显示全部楼层
webBrowser 本身就是自动执行JS的啊,跟IE没有区别吧。你是从那里看到没有执行或者是执行结果不一样的
回复

使用道具 举报

 楼主| 发表于 2014-6-10 13:04:09 | 显示全部楼层
站长苏飞 发表于 2014-6-10 08:04
webBrowser 本身就是自动执行JS的啊,跟IE没有区别吧。你是从那里看到没有执行或者是执行结果不一样的

ie自带抓包。 然后点html   就可以看到了。 那个获取源代码不完整呀。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

QQ|手机版|小黑屋|手机版|联系我们|关于我们|广告合作|苏飞论坛 ( 豫ICP备18043678号-2)

GMT+8, 2024-4-30 02:10

© 2014-2021

快速回复 返回顶部 返回列表