用户界面-AutoIt:我如何在浏览器上的输入字段中书写



场景:

我登录了一个网站,想让AutoIt在输入字段中写入。

我怎样才能做到这一点?

试试这样的

   #include<IE.au3>
$sUsername = "Username"
$sPassword = "Password"
$sUrl = "https://yoururl.com"
$oIE = _IECreate($sUrl, 0, 1, 0, 1)
Sleep(2000)
$oHWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($oHWND, "", @SW_MAXIMIZE)
$oForm = _IEFormGetCollection($oIE, 0)
$oUsername = _IEFormElementGetObjByName($oForm, 'login') ; change name !
$oPassword = _IEFormElementGetObjByName($oForm, "password") ; change name !
_IEFormElementSetValue($oUsername, $sUsername)
_IEFormElementSetValue($oPassword, $sPassword)
_IEFormSubmit($oForm)

firefox也有一个UDF FF.au3,但如果你只需要在电脑上使用该脚本,我会使用防油精键。

最新更新