Sign in to follow this  
Followers 0
Thatsgreat2345

Form Wont Submit

3 posts in this topic

Im using _IEFormSubmit and the form will submit but it wont go to the grades it just goes to this page which is still the login page, and ive tryed just navigating to this but yeah it wont log me in. The problem is that the End Form tag </form> doesnt end right after the submit button

http://clackhi.nclack.k12.or.us/~claxton/w...word=MYPASSWORD

Heres what i got so far so is there anyway to press the button, controlclick doenst work because there isnt a control ID, and no im not going to send a bunch of tabs and enters, i plainly refuse to :) and of course im not done so its quite sloppy :( and IE.au3 is the newest one just renamed to IE

#include <GUIConstants.au3>
#include <String.au3>
#include <File.au3>
#include <IE.au3>
$file = @ProgramFilesDir & "\GradeChecker\CheckUpdate.ini"  
If Not FileExists($file) Then
$file = @ProgramFilesDir & "\GradeChecker\CheckUpdate.ini"
IniWrite($file,"Config","Startup","0")
IniWrite($file,"Config","Saved","0")
If IniRead($file,"Config","Startup","") = "0" And IniRead($file,"Config","Saved","") = "0" Then
DirCreate(@ProgramFilesDir & "\GradeChecker")

$GUI = GUICreate("Grade Checker", 324, 104, 193, 126)
GUICtrlCreateLabel("Name", 8, 16, 32, 17)
$name = GUICtrlCreateInput("", 56, 16, 89, 21)
GUICtrlCreateLabel("Code", 8, 48, 29, 17)
$code = GUICtrlCreateInput("", 56, 48, 89, 21,$ES_PASSWORD)
$time = GUICtrlCreateInput("", 192, 32, 73, 21)
$changetime = GUICtrlCreateUpdown($time)
GUICtrlCreateLabel("Set Time to Check", 192, 8, 92, 17)
$save = GUICtrlCreateButton("Save", 120, 80, 73, 17, 0)
GUISetState(@SW_SHOW)

While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
;; Time
If $msg = $changetime Then
    If GUICtrlRead($time) = 0 Then
        GUICtrlSetData($time,24)
    Elseif GUICtrlRead($time) = 24 Then
    GUICtrlSetData($time,1)
EndIf
EndIf
;;;;;;;;;;;;;;;;;;;;;;;;;;;
If $msg = $save Then
If  Guictrlread($name) = "" Or GUICtrlRead($code) = "" Or GUICtrlRead($time) = ""   Then
    MsgBox(0,"Sorry","Sorry you didn't fill out a form")
Else
    _FileCreate($file)
    IniWrite($file,"Config","Startup","1")
    IniWrite($file,"Config","Name",GUICtrlRead($name))
    IniWrite($file,"Config","Code",GUICtrlRead($code))
    IniWrite($file,"Config","Time",GUICtrlRead($time))
    IniWrite($file,"Config","Saved","0")
    FileCreateShortcut(@ProgramFilesDir & "\GradeChecker\UpdateCheck.exe", @StartupDir & "\Grade Updater.lnk")
EndIf
EndIf
WEnd
EndIf
Elseif IniRead($file,"Config","Startup","") = "1" And IniRead($file,"Config","Saved","") = "0"  Then
TrayTip("Checking...","Checking Klaxton",5)
$IE = _IEcreate("http://clackhi.nclack.k12.or.us/~claxton/webgrades/",0,1)
sleep(2000)

$formKlax = _IEFormGetObjByName($IE,"authorization")
$username = _IEFormElementGetObjByName($formKlax,"username")
$password = _IEFormElementGetObjByName($formKlax,"password")
_IEFormElementSetValue($username,IniRead($file,"Config","Name",""))
_IEFormElementSetValue($password,IniRead($file,"Config","Code",""))
sleep(5000)
_IEFormSubmit($formKlax)
Sleep(10000)
_IEloadwait($IE)
_FileCreate(@ProgramFilesDir & "\GradeChecker\Klaxton.html")
FileWrite(@ProgramFilesDir & "\GradeChecker\Klaxton.html",_IEDocReadHTML($IE))
Sleep(2000)

TrayTip("Checking...","Checking Utterback",5)
_IENavigate($IE,"http://clackhi.nclack.k12.or.us/~utterbackn/grades/")
$formUtter = _IEFormGetObjByName($IE,"authorization")
$username = _IEFormElementGetObjByName($formUtter,"username")
$password = _IEFormElementGetObjByName($formUtter,"password")
_IEFormElementSetValue($username,IniRead($file,"Config","Name",""))
_IEFormElementSetValue($password,IniRead($file,"Config","Code",""))
_IEFormSubmit($formUtter)
_IEloadwait($IE)
_FileCreate(@ProgramFilesDir & "\GradeChecker\Utterback.html")
FileWrite(@ProgramFilesDir & "\GradeChecker\Utterback.html",_IEDocReadHTML($IE))
Sleep(2000)

TrayTip("Checking...","Checking Kraus",5)
_IENavigate($IE,"http://clackhi.nclack.k12.or.us/~kraussWeb/webgrades1/")
$formUtter = _IEFormGetObjByName($IE,"authorization")
$username = _IEFormElementGetObjByName($formUtter,"username")
$password = _IEFormElementGetObjByName($formUtter,"password")
_IEFormElementSetValue($username,IniRead($file,"Config","Name",""))
_IEFormElementSetValue($password,IniRead($file,"Config","Code",""))
_IEFormSubmit($formUtter)
_IEloadwait($IE)
_FileCreate(@ProgramFilesDir & "\GradeChecker\Utterback.html")
FileWrite(@ProgramFilesDir & "\GradeChecker\Kraus.html",_IEDocReadHTML($IE))
Sleep(2000)
IniWrite($file,"Config","Saved","1")
ElseIf IniRead($file,"Config","Startup","") = "1" And IniRead($file,"Config","Saved","") = "1" Then
    MsgBox(0,"Test","This is a Test")
EndIf

Share this post


Link to post
Share on other sites



Very, Very often these days forms are not submitted with a simple submit action, but rather are submitted with a Javascript onclick event tied to the submit button.

To do this, get a reference to the submit button just as you did with the other form elements and then "click" it:

$oSubmit = _IEFormElementGetObjByName($oForm, "Name-of-submit")

_IEAction($oSubmit, "click")

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Very, Very often these days forms are not submitted with a simple submit action, but rather are submitted with a Javascript onclick event tied to the submit button.

To do this, get a reference to the submit button just as you did with the other form elements and then "click" it:

$oSubmit = _IEFormElementGetObjByName($oForm, "Name-of-submit")

_IEAction($oSubmit, "click")

Dale

:) I LOVE YOU DALE

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0