|
本帖最后由 antony410 于 2014-4-26 22:36 编辑
我用了模拟点击,但因每台机的屏幕分辨率不一定相同,有时点击不到位,所以通用性不高。
试了一些,例如:_IELinkClickByText, _IELinkClickByIndex 这些都点击不了。
网页源代码,好像不见有关键字,也没有link,也没有id.
(我也不懂post这种方法)
求解:是一个内部网页,想点击第一个"学习"这个链接,如何点击?
为什么这个(源码中)框架里面没有"学习"这个链接,是不是框架跳转去了其它地方.是不是这样理解。
望大臣赐教!
如下图1:
4.26补充一些线索:
1.就是用鼠标指向"学习"这个链接时,就会在IE的左下角显示一些提示,如下图2:
2.如果用鼠标手动点击这个"学习"链接,就会弹出另外一个IE链接,内容好像是flash学习课程。
IE的标题好像是网址的一部分。但未点击"学习"这个链接之前跟本就不知道网址是什么。
因为每个"学习"的cid和mypid都不相同。
如下图3:
求解:是一个内部网页,想点击第一个"学习"这个链接,如何点击?
图1的网页源代码如下:
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" class="of">
<head>
<base href="http://oa.cn******.com:80/portal/root/login.jsp">
<meta name="keywords" content="" />
<meta name="description" content="" />
<title>欢迎访问**内部门户</title>
<link rel="shortcut icon" href="/portal/RES/css/images/favicon.ico" type="image/x-icon" />
<script src="http://oa.cn******.com/infoResource/news/portal/soaNST/soaNST3/js/jquery.js"></script>
<link type="text/css" href="http://oa.cn******.com/infoResource/news/portal/soaNST/soaNST3/login/css/common.css" rel="stylesheet">
<link type="text/css" href="http://oa.cn******.com/infoResource/news/portal/soaNST/soaNST3/login/css/login.css" rel="stylesheet">
<script src="http://oa.cn******.com/infoResource/news/portal/soaNST/soaNST3/login/js/soa_login.js" type="text/javascript"></script>
<style>
.soa-login-bg{ _filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://oa.cn******.com/infoResource/news/portal/soaNST/soaNST3/login/css/images/soalogin_bg.png');}
/*弹出框*/
.extra-info,.extra-info-3,.extra-info-4,.extra-info-6,.extra-info-14,.extra-info-15,.extra-info-17{display:none;position:absolute;left:50%;margin-left:-239px;width:176px;
padding-top:6px;z-index:99999;overflow:hidden}
.extra-info-bg{position:absolute;left:0;top:0;width:100%;height:9999px;background:#000;opacity:0.3;filter:Alpha(opacity=30);}
.extra-info-box{position:relative;margin:0 6px 6px 6px;background:#fff;overflow:hidden;}
.extra-info-title{height:31px;border-bottom:1px solid #CECECE;background:#f0efef;}
.extra-info-title h3{padding-left:10px;line-height:32px;font-size:14px;font-weight:700;}
.extra-info-cont{position: relative; /*padding:10px 20px;*/ text-align: center; padding:16px 0;}
b.close{ position:absolute; display:block; height:15px; width:15px; cursor:pointer; right:15px; top:18px; background:url(../RES/soaNewStyle/original/login/css/images/close-x.png) no-repeat left top;}
#grayLayer {background:#000000;display: none;left: 0;opacity: 0.3;filter:Alpha(opacity=30);position: absolute;top: 0;z-index: 11000;}
.load_yun { position:relative; top:2px; left:6px; color:#0081CC;}
.load_yun:hover { color:#0081CC;}
</style>
<script>
function submit_form() {
if (document.form1.j_username.value == ""){
document.getElementById("error").innerHTML = "工号不能为空";
document.getElementById("error").style.display = "block";
document.form1.j_username.focus();
return false;
}
if (document.form1.j_password.value == ""){
document.getElementById("error").innerHTML = "密码不能为空";
document.getElementById("error").style.display = "block";
document.form1.j_password.focus();
return false;
}
rememberUserName();
}
document.onkeydown = function(event) {
var e = window.event || event;
if(e.keyCode == 13) {
submit_form();
}
}
function loaderror(){
var msg = "WRONGPASSWORD";
if('NOSUCHUSER' == msg){
document.getElementById("error").innerHTML = '该用户不存在,解决方案详见帮助';
document.getElementById("error").style.display = "block";
}else if ('WRONGPASSWORD' == msg){
document.getElementById("error").innerHTML = '工号或密码不正确,解决方案详见帮助';
document.getElementById("error").style.display = "block";
}else if ('LDAPLOSED' == msg){
document.getElementById("error").innerHTML = '长时间未操作,用户信息失效,请重新登入';
document.getElementById("error").style.display = "block";
}
//增加页面加载获取绑定关系
var value = $("#j_username").val();
getEmployeeBind(value);
//增加onchange事件;
$("#j_username").change( function() {
var juserVal = $(this).val();
getEmployeeBind(juserVal);
});
}
function rememberUserName(){
var re=/^[0-9]{0,}$/;
var employeeName = document.form1.j_username.value;
if(!re.test(employeeName)){
document.getElementById("error").innerHTML = "工号只能为8位数字";
document.getElementById("error").style.display = "block";
document.form1.j_username.focus();
return false;
}
var flag = "0";
if($(".remember i").hasClass("on")){
flag = "1";
}
$.ajax( {
url : "/portal/rememberUserName.htm",
type : "post",
cache : false,
async : true,
data : {"employeeName":employeeName,"flag":flag},
success : function(data) {
if(data=="1"){
document.form1.submit();
}
}
});
}
function getEmployeeBind(juserVal){
if("" == juserVal){
$("#snyl").hide();
$("#j_snyl_type").val("0");
}
$.ajax( {
url : "/portal/snyl/queryBindEmployee.htm",
type : "post",
cache : false,
async : true,
data : {"employeeId":juserVal
},
success : function(data) {
if("E" != data){
//document.form1.style.marginTop="-20px";
$("#snyl").show();
$("#j_snyl_type").val("1");
}else{
//document.form1.style.marginTop="0px";
$("#snyl").hide();
$("#j_snyl_type").val("0");
}
}
});
}
</script>
</head>
<body class="gray-bg of" onload="loaderror()">
<div id="body" class="body">
<script type="text/javascript">
(function(){
var _Dwarf = screen.height < 800,
_loginHeight = 340,
_wrap = document.getElementById('body');
if(_Dwarf) {
_wrap.style.backgroundPosition = "center -24px";
}
load_pad();
window.onresize = load_pad;
function load_pad(){
var _temp = 0, _bodyHeight = document.documentElement.clientHeight;
if(_bodyHeight > _loginHeight){
temp = (_bodyHeight-_loginHeight)/2 ;
if(_Dwarf) {
temp += (temp <= 120 ? 28 : 0);
}
} else {
temp = 0;
}
_wrap.style.paddingTop = temp + "px" ;
}
})();
</script>
<!-- 登陆界面[[-->
<div class="soa-login-bg">
<div class="soa-login">
<!--http://oa.cn******.com:80/******UUMWeb/AuthenticationServlet ../j_security_check-->
<form name="form1" style="margin: -15px" method="post" action="http://oa.cn******.com:80/******UUMWeb/AuthenticationServlet">
<input type="hidden"
name="UUM_SYSTEM" value="UWPPORTAL" /> <input type="hidden"
name="UUM_COMPANYCODE"
value="oa.cn******.com" />
<input id="j_snyl_type" name="j_snyl_type" type="hidden" value="0" />
<table>
<tr height="20"><td> </td><td><span id="error" style="display:none;" class="c-red ml5"></span></td></tr>
<tr height="40"><td><label>用户名:</label></td><td><span class="uText login-text user"><em></em><input name="j_username" id="j_username" type="text" value=""/></span></td></tr>
<tr height="40"><td><label>密<i class="w16"></i>码:</label></td><td><span class="uText login-text password"><em></em><input name="j_password" type="password" value="" /></span>
</td></tr>
<tr height="70"><td> </td><td><a style="cursor: pointer" onclick="submit_form()" class="u-btn"><span>登 录</span></a><span class="remember"><i ></i>记住用户名</span>
<p class="links"><a href="/portal/changePss/changePssStep.htm">忘记密码</a>
<a href="/portal/loginForHelp/redirectToHelp.htm">帮助</a></p></td></tr>
</table>
</form>
</div>
</div>
<!--]]登陆界面 -->
</div>
<!-- 弹出框 -->
<div class="winctrl extra-info-6">
<div class="extra-info-bg"></div>
<div class="extra-info-box">
<div class="extra-info-title">
<h3></h3>
</div>
<div class="extra-info-cont">
<p><img src="../RES/soaNewStyle/original/login/css/images/QuickMark.png" width="113" height="113" /></p>
</div>
</div>
<b class="close closepopW"></b>
</div>
<div id="grayLayer">
<iframe style="position:absolute;top:-5px;left:0;border:none;width:100%;height:100%;background:#666666;filter:alpha(opacity=0);" ></iframe>
</div>
<script>
$(function(){
function popup(obj,cObj,popObj,boolLocalCenter,boolLayer){
var popTarget = obj;
popTarget.click(function(){
//打开关闭遮罩层
function grayLayerAction(bool){
var grayLayer = $("#grayLayer");
if(bool){
grayLayer.css({display:"block",width:$(window).width()+"px",height:$(document).height()+"px"});
}else{
grayLayer.hide();
}
}
//打开弹出框
function openWin(obj1,boolC){
obj1.show();
if(boolC){ //1居中显示
obj1.css({top:($(window).height()-obj1.height())/2+$(window).scrollTop()+"px"});
}else{ //0跟随显示
obj1.css({top:obj.offset().top-obj1.height()-5+"px",left:obj.offset().left+"px",marginLeft:0});
}
}
//关闭弹出框
function closeWin(obj2){
obj2.hide();
grayLayerAction(false);
}
grayLayerAction(boolLayer);
openWin(popObj,boolLocalCenter);
//关闭
cObj.click(function(obj2){
closeWin(popObj);
});
$(window).resize(function(){
var ncw = document.documentElement.scrollLeft+document.documentElement.clientWidth;
$("#grayLayer").width(ncw);
})
})
function CloseWebPop(){$(".winctrl").hide();$("#grayLayer").hide();}
}
popup($("#load_yun"),$(".closepopW"),$(".extra-info-6"),0,0);
});
</script>
</body>
</html>
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?加入
×
|