请问Java怎么编写代码访问一个网址然后在搜索栏自动的输入信息搜索啊 也就是打开一个ie浏览器之后怎么再自动的打开主页里面的另一个链接Java浏览器Internet Explorer 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 新建两个页面test1.html,test2.html进行测试,代码如下,打开test1,点击链接就可以查看效果了test1:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><!-- saved from url=(0044)http://129.25.98.173/portal/filedownload.jsp --><HTML><HEAD><TITLE>测试</TITLE><BODY ><a href="test2.html?opentwo=1" target="_blank">打开test2页面同时点击链接</a> </BODY></HTML>test2:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"><!-- saved from url=(0044)http://129.25.98.173/portal/filedownload.jsp --><HTML><HEAD><TITLE>被打开的页面</TITLE> <script> //获取参数 function getURLSearch(isParent){ var strSearch =""; if(isParent){ strSearch= window.parent.location.search; } else{ strSearch= location.search; } var reg1 = /=/gi; var reg2 = /&/gi; strSearch = strSearch.substr(1, strSearch.length); strSearch = strSearch.replace(reg1, '":"'); strSearch = strSearch.replace(reg2, '","'); if (strSearch == "") return null; else strSearch = '{"' + strSearch + '"}'; eval("var ArrayUrl=" + strSearch); return ArrayUrl; } //页面onload function loadPage(){ if(getURLSearch().opentwo=="1"){ document.getElementById("toBaiDu").click(); } } </script><BODY onload="loadPage()"><a href="http://www.baidu.com" id="toBaiDu" target="_blank">页面的链接</a> </BODY></HTML> 这个怎么运行啊??不是Java语言把 为什么有时java程序运行很卡? java扫雷程序,胜利了怎么判定,就可以弹出胜利的窗口 高分求教,HttpUrlConnection发送post请求,附源码 hashmap的并发保护以及iterator的快速失败 java界面美化问题 关于java applet的一个问题 新手遇到这个异常怎么解决 现在我要画一个数据流程图,请问怎么画?我没有数据流程图的符号。 为什么 import不了 javax.mail.*? 但在HELP里有啊, 请问怎么IMPORT? 大侠帮帮小虾米 String正则扣取指定的内容? 为什么我autoCompleteTextView里面显示的字体都是白色的啊
test1:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0044)http://129.25.98.173/portal/filedownload.jsp -->
<HTML><HEAD><TITLE>测试</TITLE>
<BODY ><a href="test2.html?opentwo=1" target="_blank">打开test2页面同时点击链接</a>
</BODY>
</HTML>test2:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0044)http://129.25.98.173/portal/filedownload.jsp -->
<HTML><HEAD><TITLE>被打开的页面</TITLE>
<script>
//获取参数
function getURLSearch(isParent){
var strSearch ="";
if(isParent){
strSearch= window.parent.location.search;
}
else{
strSearch= location.search;
}
var reg1 = /=/gi;
var reg2 = /&/gi;
strSearch = strSearch.substr(1, strSearch.length);
strSearch = strSearch.replace(reg1, '":"');
strSearch = strSearch.replace(reg2, '","');
if (strSearch == "")
return null;
else
strSearch = '{"' + strSearch + '"}';
eval("var ArrayUrl=" + strSearch);
return ArrayUrl;
}
//页面onload
function loadPage(){
if(getURLSearch().opentwo=="1"){
document.getElementById("toBaiDu").click();
}
}
</script>
<BODY onload="loadPage()"><a href="http://www.baidu.com" id="toBaiDu" target="_blank">页面的链接</a>
</BODY>
</HTML>