问题
I’ve been away from Autoit for a while and I’m looking to rewrite my scripts to use Firefox instead of IE.
I would appreciate someone pointing me to some example scripts which, for example, show how to open Firefox to a predetermined website and submit a username and password.
Thanks!
I have tried this code
$off=Run(@ProgramFilesDir & "\Mozilla Firefox\firefox.exe " & $url, "", @SW_MAXIMIZE)
_FFLoadWait($off)
;_FFConnect()
while(_FFLinkClick ("Continue to this website (not recommended).","text"))
_FFLoadWait($oFF,10000)
wend
If _FF_AutoLogin($uName,$pwd, $url, "login was successful", "submit", 0, 1) Then MsgBox(0,"","Login was successful")
;window.content.document.value(formUID)=_FFObj($uName, "value")
;_FF_AutoLogin($uName,$pwd,$url)
_FFSetValueById($uName,$formUID)
_FFSetValueById($pwd,$formPID)
;$oSubmit = $oFF.document.getElementById($formSubmit)
_FFClick ($formSubmit,"id")
I have installed mozrepl also..
回答1:
Here an example to connect to facebook :
#include <ff.au3>
Local $uName="The_E-Mail_adress_to_your_facebook_account"
Local $Pwd="Your facebook password"
_FFstart()
If _FFConnect(Default, Default, 3000) Then
_FF_AutoLogin($uName, $Pwd, "www.facebook.com","","keypress")
if _FFLoadWait() Then MsgBox("","Your Facebook is loaded","OK")
endif
来源:https://stackoverflow.com/questions/24028901/how-to-fill-web-forms-automatically-in-autoit-script-using-firefox-instead-of-ie