Page 1 of 3 123>
Topic Options
#105505 - 2003-10-04 09:02 PM Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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 Offline
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
#105507 - 2003-10-04 09:15 PM Re: Is it possible to update a web page with a KiXtart script?
Richie19Rich77 Offline
Seasoned Scripter
*****

Registered: 2002-08-16
Posts: 624
Loc: London, England
Just text ??, if so why not create the text field on the html too look at a word document or text document, and just let them update that.

[ 04. October 2003, 21:15: Message edited by: Richard Farthing ]

Top
#105508 - 2003-10-04 09:18 PM Re: Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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 Offline
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 Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4562
Loc: USA
Shawn and Lonkero helped me with this in the past... see http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB14&Number=99787&Forum=All_Forums&Words=7141&Match=Username&Searchpage=12&Limit=25&Old=allposts&Main=99787&Search=true#Post99787 for some possible ideas.

Edited by Al_Po (2004-11-17 11:28 PM)

Top
#105511 - 2003-10-04 09:58 PM Re: Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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 Offline
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 Offline
Getting the hang of it

Registered: 2003-04-23
Posts: 58
Sorry all,

Answered it myself.

Top
#105514 - 2003-10-09 08:25 AM Re: Is it possible to update a web page with a KiXtart script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
jacko, shawn gave you IE code, which is cool.
but if you need to know some things.
what is the login type? FTP perhaps?
updating a website is like... well simple.

I might offer to do the job for you but then I might offer to get some money too [Big Grin]

give little bit more info.
is the stuff you need to update an page or source container?

give litte bit more info and you should have a script running in no time.
_________________________
!

download KiXnet

Top
#105515 - 2003-10-11 01:44 AM Re: Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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
#105516 - 2003-10-11 03:57 PM Re: Is it possible to update a web page with a KiXtart script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you need to know does the page use form.
if yes, you need to look at the action.
if the submit button does jscript, you need to read the code what it does...
I still think you don't need the IE at all.
but without more info can't do much.

the source-code would indeed help a lot.
you may not be able to post it though without PostPrep.
_________________________
!

download KiXnet

Top
#105517 - 2003-10-11 07:14 PM Re: Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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">&nbsp;
</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">&nbsp;</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">&nbsp;</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">&nbsp;</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><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->LoanBright has a new mortgage industry specific Sales Force Automation tool we call
our "Response Management System" or RMS.</p>
<p><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->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">&nbsp;</td>
<td width="291">
<div style="text-align: justify">
<p><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->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><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->Using the LoanBright RMS system will improve management productivity, dramatically increase revenues and lower your
marketing costs per closed and funded loan.</p>
<p><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->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><!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-->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">&nbsp;</td>
</tr>
<tr>
<td>
<div align="center"><font color="#000000" face="Arial" size="1">Copyright
&copy; 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
#105518 - 2003-10-11 08:47 PM Re: Is it possible to update a web page with a KiXtart script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
="lb_login.asp"

so, something like this should do:
http://thesite.com/lb_login.asp?posting=0;custid=myid;pw=mypass
_________________________
!

download KiXnet

Top
#105519 - 2003-10-12 02:53 AM Re: Is it possible to update a web page with a KiXtart script?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
That would require a GET request. However, the HTML page is using a POST request where the form parameters are transported via the HTTP header. See for example http://www.cs.tut.fi/~jkorpela/forms/methods.html for more info.
_________________________
There are two types of vessels, submarines and targets.

Top
#105520 - 2003-10-12 03:07 AM Re: Is it possible to update a web page with a KiXtart script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the page uses, that's right.
but that does not mean you can't use get!

post is for long data but get does work just fine for this one.
the only visible difference with get and post is that with GET the parameters are always seen in addy field where as POST enables also the hidden values.

[ 12. October 2003, 03:08: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#105521 - 2003-10-14 09:10 AM Re: Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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 [Confused] ). What am I doing wrong?
Thanks again for your help

J

Top
#105522 - 2003-10-14 11:12 AM Re: Is it possible to update a web page with a KiXtart script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
heh, not sure you do anything wrong.
did you try my "login" url?

try it in IE addy and tell what it says.
btw, once you are in, you don't need IE anymore but the rest of the stuff can be done with other stuff. lot easier.
_________________________
!

download KiXnet

Top
#105523 - 2003-10-14 05:10 PM Re: Is it possible to update a web page with a KiXtart script?
jacks73 Offline
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
#105524 - 2003-10-14 09:00 PM Re: Is it possible to update a web page with a KiXtart script?
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I forgot one jscript part but thought you would maybe find it.
try this:
http://thesite.com/lb_login.asp?posting=1;custid=myid;pw=mypass

the point still remains:
forget the IE.
with some info about the page after logon (which happens with simple URL, when correctly set up, again,try above) we can do really simple upload script with com without IE.

anyway, before you get in, we can't go that far, so.. try the above URL.
_________________________
!

download KiXnet

Top
Page 1 of 3 123>


Moderator:  Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 229 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.091 seconds in which 0.042 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org