找回密码
 加入
搜索
查看: 4868|回复: 6

[网络通信] 这种网页怎么点击登录?无name信息

  [复制链接]
发表于 2015-2-26 08:41:34 | 显示全部楼层 |阅读模式
探测到的如下:
网页地址:http://192.168.1.60/restart5.htm
网页标题:Hardlink USB MFP 服务器
网页编码:gb2312
网页元素:INPUT【输入表单(提交按钮)】主页面
元素标记:name="" id=""
元素矩形:60x22
元素属性:可视=√ 禁止=X
父 对 象:FONT【渲染文本字体】

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
发表于 2015-2-26 09:19:04 | 显示全部楼层
附上你的网页源代码,不然不懂你的是什么
 楼主| 发表于 2015-2-26 11:38:39 | 显示全部楼层
回复 2# kemyliu
来了,我贴上网页源代码
<HTML><HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="generator" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<TITLE>Hardlink USB MFP 服务器</title>
</HEAD>
<BODY >
<script language="JavaScript">
function abortLogin()
{
    window.location="systemstatus.htm";
    return;
}
</script>

<font face="Times New Roman">
<p align=center> 
  <table>
    <tr>
      <td><br><br>  </td>
    </tr>
  </table>

</font>

<form name="form" method="post">
  <table height="120" cellSpacing="4" width="300">
    <tr bgColor="silver">
      <td width="300" colSpan="2" bgColor="#ffffff" height="36"><b><font size="4">登入</font><font face="Times New Roman">Hardlink MFP 
</font>
        <font size="4">打印服务器</font></b></td>
    </tr>
    <font face="Times New Roman">
<!--
    <tr bgColor="silver">
      <td width="350" colSpan="2" height="19"><b>Administrator Name and Password</b></td>
    </tr>
-->
    <tr bgColor="#f0f0f0">
      <td width="100" height="21">  
</font>
      用户名 </td>
      <td width="200" height="21" align="center"><input maxLength="15" name="username_value" size="24"></td>
    </tr>
    <font face="Times New Roman">
    <tr bgColor="#f0f0f0">
      <td width="100" height="21">  
</font>
      密码 </td>
      <td width="200" height="21" align="center"><input maxLength="15" name="password_value" size="24" type="password"></td>
    </tr>
  </table>
  <br>
  <input type="submit" value=" 登入 ">
  <input type="button" value=" 取消 " onclick="abortLogin()" >  
</form>
<SCRIPT Language=javascript>
<!--
document.form.elements(0).focus();
-->
</SCRIPT>
</BODY></HTML>

<!--
<p align="center"> </p>
<p align="center"><img src="kc300.jpg"></p>
<p align="center"> </p>
<p align="center">Please enter user name and password to login.</p>
        <form name="form1" method="post">
            <p align="center">User Name:<input type="text" name="username_value" maxlength="15" size="16"></p>
<p align="center"> Password : <input type="password" name="password_value" maxlength="15" size="16"></p>
    <p align="center"><input type=submit value=" Login " >    <input type="button" value=" Cancel " onclick="abortLogin()" ></p>
</form>
</BODY></HTML>
-->
发表于 2015-2-26 14:37:45 | 显示全部楼层
#cs==========================================================================
        ;作者: 风行者
        ;version 4.0
        
        通用获取元素对象
        #include <IE.au3>
        _IEQuery(ByRef $o_object,$_Eletag,$_Elepro)
        
        参数
        $o_object InternetExplorer.Application, 窗口, 框架或者任意DOM对象的对象变量
        $_Eletag  元素标签名
        $_Elepro  元素属性列表,以逗号为分隔符
        $_Flag  标志:true 只返回找到第一个元素,false 返回找到的元素数组
        
        返回值
        成功: $_Flag=false,返回元素对象数组,数组元素的数量储存在零号元素 $IE_array[0] 中
                  $_Flag=true ,返回找到第一个元素
        失败: 返回0 并且设置@ERROR
        @Error: 0 ($_IEStatus_Success) = 无错误
        1 = 没有找到元素对象
        3 ($_IEStatus_InvalidDataType) = 无效数据类型
        4 ($_IEStatus_InvalidObjectType) = 无效对象类型
        
        注意/说明
        属性列表支持属性:name,id,type,value,class,title,outertext,outerhtml
        innertext,innerhtml,href,src,alt
        
        属性值允许使用双引号括起,特别是href属性值存在“=”号的情况,必须用双引号括起
        有些href属性值最后可能存在反杠"/"的情况
        
        
        ;例子1
        #include <IE.au3>
        $oIE = _IE_Example("form")
        $oEles = _IEQuery($oIE,"input",'value=gameBasketball,type=checkbox',false) ;_IEQuery(IE对象,标签名,属性列表)
        $Ele = $oEles[1]
        MsgBox(0,"",$Ele.outerhtml)
        
        ;例子2
        #include <IE.au3>
        $oIE = _IE_Example("form")
        $oEle = _IEQuery($oIE,"input",'value=gameBasketball,type=checkbox') ;_IEQuery(IE对象,标签名,属性列表)
        MsgBox(0,"",$oEle.outerhtml)
#ce==========================================================================
#include <IE.au3>
Func _IEQuery(ByRef $o_object, $_Eletag, $_Elepro, $_Flag = True) ;_IEQuery(IE对象,标签名,属性列表,标志)
        If Not IsObj($o_object) Then Return SetError(1,0,0)
        
        Local $_EleStr = StringSplit($_Elepro, ",")
        Local $n = $_EleStr[0] + 1
        Local $_Ele_Os[$n][$n] = [[$_EleStr[0]]]
        For $i = 1 To $_EleStr[0]
;~                 $tsp = StringSplit($_EleStr[$i],"=")
                $tsp = StringRegExp($_EleStr[$i], '(.+?)="?([^"]+)"?, 3)
                $_Ele_Os[$i][0] = $tsp[0]
                $_Ele_Os[$i][1] = $tsp[1]
        Next
        
        Local $IE_array[1], $IE_add = 1
        ;开始查找元素对象
        Local $tmp_objs 
        Do
                $tmp_objs = _IETagNameGetCollection($o_object, $_Eletag)
        Until @error = 0
        Local $IE_pertyGet = ""
        For $_tmp_obj In $tmp_objs
                For $j = 1 To $_Ele_Os[0][0]
                        Switch StringLower($_Ele_Os[$j][0])
                                Case "name"
                                        $IE_pertyGet = String($_tmp_obj.name)
                                Case "id"
                                        $IE_pertyGet = String($_tmp_obj.id)
                                Case "type"
                                        $IE_pertyGet = String($_tmp_obj.type)
                                Case "value"
                                        $IE_pertyGet = String($_tmp_obj.value)
                                Case "class"
                                        $IE_pertyGet = String($_tmp_obj.classname)
                                Case "title"
                                        $IE_pertyGet = String($_tmp_obj.title)
                                Case "outertext"
                                        $IE_pertyGet = String($_tmp_obj.outertext)
                                Case "outerhtml"
                                        $IE_pertyGet = String($_tmp_obj.outerhtml)
                                Case "innertext"
                                        $IE_pertyGet = String($_tmp_obj.innertext)
                                Case "innerhtml"
                                        $IE_pertyGet = String($_tmp_obj.innerhtml)
                                Case "href"
                                        $IE_pertyGet = String($_tmp_obj.href)
                                Case "src"
                                        $IE_pertyGet = String($_tmp_obj.src)
                                Case "alt"
                                        $IE_pertyGet = String($_tmp_obj.alt)
                                Case "target"
                                        $IE_pertyGet = String($_tmp_obj.target)
                                Case "align"
                                        $IE_pertyGet = String($_tmp_obj.align)
                                Case "vAlign"
                                        $IE_pertyGet = String($_tmp_obj.vAlign)
                                Case "style"
                                        $IE_pertyGet = String($_tmp_obj.style)
                                Case "color"
                                        $IE_pertyGet = String($_tmp_obj.color)
                                Case "bgColor"
                                        $IE_pertyGet = String($_tmp_obj.bgColor)
                                Case "onclick"
                                        $IE_pertyGet = String($_tmp_obj.onclick)
                        EndSwitch
                        
                        If $IE_pertyGet <> String($_Ele_Os[$j][1]) Then
                                ContinueLoop 2 ;不相等下一个元素
                        EndIf
                Next
                $IE_add += 1
                ReDim $IE_array[$IE_add]
                $IE_array[$IE_add - 1] = $_tmp_obj
        Next
        If $IE_add > 1 Then
                $IE_array[0] = $IE_add - 1
                If $_Flag = False Then
                        Return SetError(0, 0, $IE_array) ;成功返回元素对象数组
                Else
                        Return SetError(0, 0, $IE_array[1]) ;只返回找到的第一个元素
                EndIf
        Else
                Return SetError(1, 0, 0) ;失败返回0
        EndIf
EndFunc   ;==>_IEQuery

评分

参与人数 1金钱 +10 收起 理由
ila + 10 奉上小小的10金币,表达我的谢意。

查看全部评分

发表于 2015-2-26 14:41:13 | 显示全部楼层
看看例子
input >
#include <IE.au3>
        $oIE = _IE_Example("http://192.168.1.60/restart5.htm")
        $oEle = _IEQuery($oIE,"input",'type="submit",value=" 登入 "') ;_IEQuery(IE对象,标签名,属性列表)
        $oEle.click

评分

参与人数 1金钱 +22 贡献 +8 收起 理由
auto + 22 + 8

查看全部评分

 楼主| 发表于 2015-2-27 10:31:16 | 显示全部楼层
本帖最后由 ila 于 2015-2-27 10:38 编辑

谢谢了,搞定,是我不知道这个ie.au3
发表于 2020-8-17 08:41:26 来自手机 | 显示全部楼层
找不到_IEQuery
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-19 17:13 , Processed in 0.106048 second(s), 30 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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