#105505 - 2003-10-04 09:02 PM
Is it possible to update a web page with a KiXtart script?
|
jacks73
Getting the hang of it
Registered: 2003-04-23
Posts: 58
|
I didn't quite know where to ask this question. Is it possible to input information into an existing web-page using a KiXtart script? If so does anyone know where I might find a how-to?
|
Top
|
|
|
|
#105506 - 2003-10-04 09:09 PM
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
|
To explain a little better...
My company uses a Website that needs to be updated on a regular basis. Only the people that are supposed to do it feel it takes up to much of their time. So I was hoping to be able to write a script that gets the info from them and updates the site quietly for them. Is that possible? If not does anyone know of some software that does something similar?
|
Top
|
|
|
|
#105508 - 2003-10-04 09:18 PM
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
|
It's a site that we use, but it is not ours. We need to login to it then update the info.
|
Top
|
|
|
|
#105509 - 2003-10-04 09:27 PM
Re: Is it possible to update a web page with a KiXtart script?
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
This is very possible but how it gets done is very, very specific to the web site your going, just by way of an example heres a Kixscript that prompts you for a search term, then opens up IE and navigates to google, then automatically datafills the searchfield and clicks ok, then displays the results. How your site works will be totally different in terms of the field ID's and steps involved, but here is a start:
code:
Break On
Do ?"Enter search term> " gets $term Until $Term
$URL = "http://216.239.39.101/"
$IE = CreateObject("InternetExplorer.Application")
$IE.Visible = 1
$IE.Navigate($URL)
While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop
$IE.Document.getElementById("q").Value = $Term
$IE.Document.GetElementById("BtnG").Click()
Exit 0
-Shawn [ 04. October 2003, 21:28: Message edited by: Shawn ]
|
Top
|
|
|
|
#105510 - 2003-10-04 09:43 PM
Re: Is it possible to update a web page with a KiXtart script?
|
Allen
KiX Supporter
   
Registered: 2003-04-19
Posts: 4562
Loc: USA
|
|
Top
|
|
|
|
#105511 - 2003-10-04 09:58 PM
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
|
Shawn, Thanks for the start.
Alpo, Thanks for the link.
Both have gotten me off on the right foot, I'm gonna work on this and hopefully have some code soon. I'll keep you updated on what I figure out.
J
|
Top
|
|
|
|
#105512 - 2003-10-09 06:10 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
|
Would the variable
$IE.Silent = 1
instead of
$IE.visable = 1
run Explorer in the background in this script? code:
Break On
Do ?"Enter search term> " gets $term Until $Term
$URL = "http://216.239.39.101/"
$IE = CreateObject("InternetExplorer.Application")
$IE.visable = 1
$IE.Navigate($URL)
While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop
$IE.Document.getElementById("q").Value = $Term
$IE.Document.GetElementById("BtnG").Click()
Exit 0
[ 09. October 2003, 06:11: Message edited by: jacks73 ]
|
Top
|
|
|
|
#105513 - 2003-10-09 06:13 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
|
Sorry all,
Answered it myself.
|
Top
|
|
|
|
#105515 - 2003-10-11 01:44 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
|
Lonkero,
Thanks for the offer but i'm on a limited budget.
As for info on my issue here we go...
Modifying Shawn's script I am able to input the logon info as well as the data to update on the next page. But I haven't figured out how to click the "Login" button. The Google page is all HTML so finding the identifier for the '.click' command is the same as all the other fields. But my site is using JAVA for the button. Is there something different that I need to do to click a JAVA button?
By the way here's the script I'm using to get to the logon page.
code:
Break On
$ID = 'A name'
$PW = 'A password'
$URL = "https://169.218.243.162/script/lb_login.asp"
$IE = CreateObject("InternetExplorer.Application")
$IE.Visible = 1
$IE.Navigate($URL)
sleep 2
sendkeys('{enter}'); to clear the "Secure Logon information" window sendkeys('y'); To clear the "Certificate not updated" window
While $IE.Busy and $IE.ReadyState <> 4 and @ERROR = 0 Loop
$IE.Document.lblogin("custid").Value = $ID
$IE.Document.lblogin("pw").Value = $PW
$$IE.Document.lblogin("javascript:login").click() ; I don't know what the Identifier is to hit the button
Exit 0
I will post the source code of the page if any one wants it, but I'm just hoping for a clue to what to look for.
Again thanks for any help you offer,
J [ 11. October 2003, 01:47: Message edited by: jacks73 ]
|
Top
|
|
|
|
#105517 - 2003-10-11 07:14 PM
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
|
Good morning(my time) Lonkero,
Thanks for the direction.
Here's the page's source code
code:
<html> <head> <title>thesite.Com Login</title> <script> <!-- function login_onclick() { // Validations if ( isNaN(document.lblogin.custid.value)) { alert( "Please enter a valid ID" ); document.lblogin.custid.focus(); return; }
if ( document.lblogin.custid.value=="" ) { alert( "Please enter ID" ); document.lblogin.custid.focus(); return; } if ( document.lblogin.pw.value=="" ) { alert( "Please enter Password" ); document.lblogin.pw.focus(); return; } // all is well document.lblogin.posting.value = 1 document.lblogin.submit(); return; } //--> </script> <style type="text/css"> <!-- body,p,table,tr,td,ul,li { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; color: #000000;} .roll1 { font-family:Arial; font-size:8pt; font-style:normal; font-weight:bold; color:white; } A.roll1:hover { color:yellow; } .roll2 { font-family:Arial; font-style:normal; font-weight:normal; color:black; } A.roll2:hover { color:red; } --> </style> </head> <body onLoad="document.lblogin.custid.focus()" bgcolor="#FFFFFF"> <table border="0" width="600" align="center"> <tr> <td height="40"><img src="/images/loanbright02.gif" width="261" height="34"></td> </tr> <tr bgcolor="#333366"> <td height="19"> <div align="center"> </div> </td> </tr> <tr> <td height="300"> <form action="lb_login.asp" method="post" name="lblogin" id="lblogin"> <input type="hidden" name="posting" value="0"> <table width="400" border="0" align="center"> <tr bgcolor="#cccc99"> <td colspan="2"> <div align="center"><b>Login Information</b></div> </td> </tr> <tr> <td colspan="2"> <div align="center"><i>ID and Password are required for access.</i> </div> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="195"> <div align="right">ID</div> </td> <td width="195"> <input type="text" name="custid" size="20" maxlength="20" value="1246"> </td> </tr> <tr> <td width="195"> <div align="right">Password</div> </td> <td width="195"> <input type="password" name="pw" size="20" maxlength="20" value=""> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="195" height="25"> <div align="right"> <a href="javascript:login_onclick()"><img src="/images/login.gif" width="76" height="24" border="0"></a></div> </td> <td width="195" height="25"> <a href="javascript:window.location.href='/default.htm'"><img src="/images/cancel.gif" width="76" height="24" border="0"></a> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> <div align="center">Forget your password or having problems? Please <a class="roll2" href="mailto:support@loanbright.com">drop us a line</a>. </div> </td> </tr> </table> <table border="0" width="600" align="center"> <br> <tr> <td colspan="3" align="center"> <font size="3" face="Arial"> <b>Want to automatically distribute our Leads to your Loan Officers?<br> Want to keep track of how your leads get worked?<br> Want to improve conversions from lead to closed loan?</b><br> </font> <br> </td> </tr> <tr> <td width="291"> <div style="text-align: justify"> <p><!-- -->LoanBright has a new mortgage industry specific Sales Force Automation tool we call our "Response Management System" or RMS.</p> <p><!-- -->The LoanBright RMS system allows a sales manager or supervisor to automatically distribute CompareInterestRates.Com leads, in real time, to his/her loan officers using business rules or filters. The LoanBright RMS system then tracks and keeps track of how fast each loan officer first contacts each potential borrower.</p> <p><br><center><b>The LoanBright RMS system:</b></center></p> <p><ul> <li>Automatically distributes leads in real time to your loan officers - even in remote offices.</li> <li>Eliminates the need for email forwarding or printing and manual distribution of leads.</li> <li>Tracks how fast each loan officer contacts each potential borrower.</li> <li>Keeps track of how many leads each loan officer has received.</li> <li>Allows you to compare and contrast loan officer performance.</li> <li>Provides new loan officers with a turnkey sales process.</li> <li>Provides sales managers with a robust set of sales analytics reports.</li> </ul></p> </div> </td> <td width="18"> </td> <td width="291"> <div style="text-align: justify"> <p><!-- -->The bottom line is the LoanBright RMS system provides you with a tool to better manage your leads and your sales force, resulting in better conversions from lead to loan application to closed and funded loan. </p> <p><!-- -->Using the LoanBright RMS system will improve management productivity, dramatically increase revenues and lower your marketing costs per closed and funded loan.</p> <p><!-- -->Because the system is 100% web browser-based, there is no software to install. Loan Officers just navigate their browser to the appropriate web address and begin utilizing the Sales Force Automation functionality of the LoanBright RMS system. Because the application is web-based, loan officers can utilize the system working from any location with Internet access.</p> <p><!-- -->If you need more information on the LoanBright RMS system, please call your account executive at 888-330-3330 or email us at <a class="roll2" href="mailto:sales@loanbright.com?subject=I want more information on RMS">sales@loanbright.com</a></p> <p><br><br><br><br><br><br></p> </div> </td> </tr> </table> </form> </td> </tr> <tr bgcolor="#FFFFFF"> <td height="19"> </td> </tr> <tr> <td> <div align="center"><font color="#000000" face="Arial" size="1">Copyright © LoanBright 2000 - 2003, All Rights Reserved.</font> </div> </td> </tr> </table> </body> </html>
What I'm trying to do is to login to this page to get to the next page and enter some data. If the site were mine I could just have the site itself pull the data. However, it is a hosted site so I can't. The information only changes on a daily basis but my boss wants to post to it frequently. This site is an information gathering page for another search page that posts this data to customers, and my boss wants to achieve one of the first three positions.
|
Top
|
|
|
|
#105521 - 2003-10-14 09:10 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
|
Lonkero/Jens,
Again thanks for the clues. If I have already logged into the first page and leave it open the following script will open another instance of the second page. code:
Break On
$ID = 'A name'
$PW = 'pwd'
$URL = "https://169.218.223.163/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.Post.(lblogin).submit()
Exit 0
But try as I may I can't login without intervention(and I need to ). What am I doing wrong? Thanks again for your help
J
|
Top
|
|
|
|
#105523 - 2003-10-14 05:10 PM
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
|
I tried the url and it only opens the login page but it doesn't log-in.
I've tried opening the page and then
code:
setfocus("the site.com login - Microsoft Iternet Explorer") sendkeys({TAB2}) sendkeys({enter})
and KiXtart returns a 0 for each key sent but I get no action in IE. The Login button is the third spot on the page. [ 14. October 2003, 17:14: Message edited by: jacks73 ]
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 229 anonymous users online.
|
|
|