无法使用firefox自动脚本将值填入文本框?

时间:2014-05-30 09:52:41

标签: mozilla autoit

我无法将值填入文本框?我尝试过以下代码...``

$url = "file:///C:/Users/Desktop/HTML.html"
    $formID = ""
    $formUID = "username"
    $uName = "srv.iloadmin"
    $formPID = "password"
    $pwd = "SeR^ER@iL0"
    $formSubmit = "ID_LOGON" 
    Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe " & $url, "", @SW_MAXIMIZE)
    _FFSetValue($uName,$formUID,"id")
    _FFSetValue($pwd,$formPID,"id")

HTML脚本用户名是:

<input autocomplete="off" class="textfield" name="username" id="username" size="30" onkeypress="return checkEnter(event);" type="text">

密码:

<input autocomplete="off" class="textfield" name="password" id="password" size="30" onkeypress="return checkEnter(event);" type="password">

1 个答案:

答案 0 :(得分:1)

您需要仔细查看Firefox UDF

这是一个简单的例子:

#Include <FF.au3>

_FFConnect()
If _FFIsConnected() Then
_FFOpenUrl("http://www.example.com/news/811")
 _FFLoadWait()
_FFClick(".forms[2].elements[0]")
_FFLoadWait()
EndIf