How to fill web forms automatically in AutoIt script using Firefox instead of IE?

≡放荡痞女 提交于 2019-12-24 12:37:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!