#105546 - 2003-10-23 11:15 AM
Re: Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
Richard, Thanks for your help. I will change the case issue in my code. quote: I'm a little confused why you have both console and GUI input - are you going to create an IE input page later?
The console input is to get the variable info at the begining of each day. Then the script will go to the site and re-save the same info at specified intervals throughout the day.
quote: Also, what do you mean by "how do I pass the extra parameters"?
That question comes from this
My code:code:
$IE.Document.lblogin.posting.value = 1 $IE.Document.lblogin.Submit()
The HTML code it affects code:
// all is well document.lblogin.posting.value = 1 document.lblogin.submit(); return;
The HTML code of the 2nd page that I want to also affect(this comes from the same approx area of the source as the first. code:
document.fixrates.posting.value = 1; for (x=5; x<document.fixrates.length -4; x=x+ 7) { document.fixrates.elements[x].disabled=false; } document.fixrates.submit(); return;
There are extra statements that I'm think may be needed in my script but I don't know how to incorporate them. [ 23. October 2003, 11:16: Message edited by: jacks73 ]
|
Top
|
|
|
|
#105547 - 2003-10-23 04:45 PM
Re: Is it possible to update a web page with a KiXtart script?
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Ok well, if possible wouldn't mind seeing the source for this second page, can't speak for Richard but would be good if he could have a look as well - I know he has alot of experience in these matters. If you could just post it or email it to us (if sensitive) would be great ...
In the short term, could you just verify that the objects your accessing are actually there and created, maybe run this code:
code:
$Posting = $IE.document.fixrates.posting If $Posting ?"Posting is real, value is " + $Posting.Value Endif $FixRates = $IE.document.fixrates If $FixRates ?"FixRates is real" Endif
At least doing this, we will know we're deailing with real objects ...
-Shawn [ 23. October 2003, 16:51: Message edited by: Shawn ]
|
Top
|
|
|
|
#105548 - 2003-10-25 02:01 AM
Re: Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
OK Shawn I tried the code you posted.
and the results are strange.
whent the code runs it hits the if $posting statement and then goes on to the ?"Posting is real, value is " + $Posting.Value as though the if was true. and then nothing is printed. Then it hit the next if and prints 'Fixrates is real'
$ID = 'name'
$PW = 'pwd'
$URL = "https://www.thesite.com/script/lb_login.asp"
$IE = CreateObject("InternetExplorer.Application")
$IE.Visible = 1
$IE.Navigate($URL)
While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop
$IE.Document.getelementbyid("custid").Value = $ID $IE.Document.getelementbyid("pw").Value = $PW
$IE.Document.lblogin.posting.value = 1 $IE.Document.lblogin.Submit()
$Posting = $IE.document.fixrates.posting If $Posting ? "Posting is real, value is " +$Posting.Value ? @error @serror Endif $FixRates = $IE.document.fixrates If $FixRates ? "FixRates is real" Endif
The results of the added line are:
-2147352570 Unknown name
|
Top
|
|
|
|
#105549 - 2003-10-25 02:18 AM
Re: Is it possible to update a web page with a KiXtart script?
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Hmmm, brainstorm, what happens if you synchronize (or serialize) the document after the first submit, try this:
code:
While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop $IE.Document.getelementbyid("custid").Value = $ID $IE.Document.getelementbyid("pw").Value = $PW $IE.Document.lblogin.posting.value = 1 $IE.Document.lblogin.Submit() ; Add this second synchro ... While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop $Posting = $IE.document.fixrates.posting ; rest of code ...
-Shawn
|
Top
|
|
|
|
#105550 - 2003-10-25 02:25 AM
Re: Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
Same results
Whats puzzling is that if,
-2147352570 Unknown name
is true, then why does the statment run in the first place?
|
Top
|
|
|
|
#105553 - 2003-10-25 03:12 AM
Re: Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
Check your inbox for the source code
I added the second sync and got the same results
|
Top
|
|
|
|
#105555 - 2003-10-25 06:37 AM
Re: Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
quote: after trying, can you send me source for the first page as well ?
That source code is posted on page one of this posting.
|
Top
|
|
|
|
#105556 - 2003-10-25 06:53 AM
Re: Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
The last test you sent yields: value=1
Also, I got the first testing script to run properly. It gave me:
Posting is real, value is 0 FixRates is real
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 1574 anonymous users online.
|
|
|