#30956 - 2002-10-21 01:57 PM
Re: Open page in Internet explorer and pass values
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
You may be able to wait for the page to finish loading with:
code:
While $IE.Busy "Waiting for idle..." ? Loop
|
|
Top
|
|
|
|
#30958 - 2002-10-21 04:11 PM
Re: Open page in Internet explorer and pass values
|
Richard H.
Administrator
   
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Ok, here is an example of filling in a form and submitting it automatically.
This example uses the KiXtart search page, and set the following fields:
- Membership number to "494" (my number)
- Search forums to "all"
- Search date to "Since 5 days"
It then submits the search form.
code:
Break On ; Create application instance and open search page... $oIE = CreateObject("InternetExplorer.Application") $oIE.Visible=1 $oIE.Navigate("http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=search") ; Wait for page to stop loading... While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop $oDoc=$oIE.document ; Form is not named, so identify the form with the relevant field... For Each $oForm In $oDoc.forms ; Set membership number $oForm.search_user.value="494" ; If there is no error, then this is the right form If @ERROR = 0 ; Set the period and forum scope $oForm.search_date.value="5" $oForm.search_forum.value="ALL" ; Submit the form. $oForm.submit.click EndIf Next $oIE = 0
|
|
Top
|
|
|
|
#30968 - 2002-11-05 04:07 PM
Re: Open page in Internet explorer and pass values
|
Darren_W
Hey THIS is FUN
   
Registered: 2001-10-10
Posts: 208
Loc: Bristol, England
|
Hi,
Using: code:
$=sendkeys("~ n")
Working with Internet explorer that works for minimising the window.
Thanks
This is my final code...
code:
Break On
; Create application instance and open search page... $oIE = CreateObject("InternetExplorer.Application") $oIE.Visible=1 $oIE.Navigate("webmail.aschoolname.bristol.sch.uk")
; Wait for page to stop loading... While $oIE.busy AND $oIE.readystate <> 4 AND @ERROR = 0 Loop
$oDoc=$oIE.document
; Form is not named, so identify the form with the relevant field... For Each $oForm In $oDoc.forms ; Enter user ID $oForm.userid.value="admin" ; If there is no error, then this is the right form If @ERROR = 0 ; Enter password $oForm.password.value="{password}" ; Submit the form. $oForm.submit.click EndIf Next
$oIE = 0 $=sendkeys("~ n")
Darren [ 05. November 2002, 16:12: Message edited by: Darren ]
_________________________
I want to share something with you - the three sentences that will get you through life. Number 1, 'cover for me.' Number 2, 'oh, good idea, boss.' Number 3, 'it was like that when I got here'.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 756 anonymous users online.
|
|
|