bagas9425 Posted December 21, 2015 Posted December 21, 2015 Hi, everyone.I want to update status on FacebookHere is my code; Include IE and ScreenCapture #include <ie.au3> #include <ScreenCapture.au3> ; Login Facebook $oIE = _IECreate ("http://www.facebook.com") WinSetState("", "", @SW_MAXIMIZE) $oForm = _IEFormGetObjByName ($oIE, "login_form") $oEmail = _IEFormElementGetObjByName ($oForm, "email") $oPass = _IEFormElementGetObjByName ($oForm, "pass") $uname="xxxxxx@yahoo.com" $pwd="xxxxxxxxxxxx" _IEFormElementSetValue ($oEmail,$uname) _IEFormElementSetValue ($oPass,$pwd) $oButton=_IEGetObjById($oIE,"loginbutton") _IEAction ($oButton, "click") _IELoadWait($oIE,1000) ; Post Facebook Status Local $oFrame = _IEFrameGetObjByName ($oIE, 'textarea') Local $oForm = _IEFormGetObjByName ($oFrame, "u_0_13") Local $oTextArea = _IEFormElementGetObjByName ($oForm, 'xhpc_message_text') _IEFormElementSetValue ($oTextArea,'coba') ; Capture Screenshoot _ScreenCapture_Capture(@ScriptDir & "\SS.jpg") ; Logout Facebook _IELoadWait($oIE,1500) MouseClick("primary", 1046, 71, 1, 0) _IELoadWait($oIE,1500) MouseClick("primary", 927, 508, 1, 0) ; Exit IE _IELoadWait($oIE,1500) _IEQuit($oIE)It will login facebook, update status, capture screenshot, and logout facebook as well as internet explorer. But, for update status, I cannot do that.It's different from login facebook. Can you help me?
Danyfirex Posted December 21, 2015 Posted December 21, 2015 Hello. this work for me. Local $colForms = _IEFormGetCollection($oIE) ; get all forms For $oForm In $colForms ; loop over form collection ConsoleWrite("---- FORM " & $oForm.name & " ----" & $oForm.className & @CRLF) $oFormElements = _IEFormElementGetCollection($oForm) ; get all elements For $oFormElement In $oFormElements ; loop over element collection If StringLower($oFormElement.tagName) == 'textarea' Then ; it is a textarea If $oFormElement.name == "xhpc_message" Then _IEFormElementSetValue($oFormElement, "Hello World!!!", 0) ; set value of the field EndIf Next NextSaludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut
Developers Jos Posted December 21, 2015 Developers Posted December 21, 2015 What was the reason you felt the need to create a new account for this question?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
bagas9425 Posted December 22, 2015 Author Posted December 22, 2015 Hello. this work for me. Local $colForms = _IEFormGetCollection($oIE) ; get all forms For $oForm In $colForms ; loop over form collection ConsoleWrite("---- FORM " & $oForm.name & " ----" & $oForm.className & @CRLF) $oFormElements = _IEFormElementGetCollection($oForm) ; get all elements For $oFormElement In $oFormElements ; loop over element collection If StringLower($oFormElement.tagName) == 'textarea' Then ; it is a textarea If $oFormElement.name == "xhpc_message" Then _IEFormElementSetValue($oFormElement, "Hello World!!!", 0) ; set value of the field EndIf Next NextSaludosOh pity me, my knowledge is still below average.I will try that.What was the reason you felt the need to create a new account for this question?JosWhat do you mean? I am a new in this forum.And this is my account. Pardon me if I have registered with other username.
bagas9425 Posted December 22, 2015 Author Posted December 22, 2015 Yes it's worked to input status on textarea.But, I cannot submit that. What's command that I can use?
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now