Forum Moderators: open

Message Too Old, No Replies

Unable to create script using casper.grabpage

         

Warlockvix

12:08 am on Aug 1, 2003 (gmt 0)

10+ Year Member



Hello. First, I must mention that I am a complete newbie at using ASP and my knowledge of VB is very little. I am trying to program an ASP script using casper.GrabPage to copy a webpage and then format the information copied from that web page and create a completely different webpage. I am using the below script to do this and the HTML code for the source webpage is also below. The problem is that the header appears, but nothing else.
I have been scouring the ASP and VB forums, but my knowledge is limited so I am not to sure what I am looking for. I am hoping someone can tell me what I am doing wrong or at least give me some suggestions on where I can look for help. Thanks in advance!

ASP:

<!-- #include file="shared.inc" -->

<H1>TuCows "News Ticker" Demo:</H1><HR>
<%

Dim Url, GP, NewFormat, Results, i, j, k, Fund, Funds, Table, Name

Set GP = CreateObject("cASPer.GrabPage")

'Define the format to be used for extracting data
NewFormat = Array( _
Array("Item", "<!-- Begin template program_list_body-->", _
"<!-- End included template size_download.txt -->", Array( _
Array("Name", "<a name=""", """>"), _
Array("TitleRegion", "<B><A HREF=""", "</B><BR>", Array( _
Array("Title", """>", "</A>") _
)), _
Array("Description", vbCrLf & " ", "<BR><BR></TD>"), _
Array("Rating", ".gif"" BORDER=""0"" ALT=""", """ WIDTH="""), _
Array("Size", "<B>" & vbCrLf, vbCrLf) _
)) _
)
GP.PageFormats.Add NewFormat, "Page"

'Execute the request
On Error Resume Next
GP.Execute "http://glcsc06lna04.keybank.com/specserv/WebTick.nsf/e608ab022feee391852567630064436f?OpenView"
If Err.Number <> 0 Then
Write "Error grabbing page: " & Err.Description
Response.End
End If
On Error GoTo 0

'Extract the useful data based on our format
Set Results = GP.ExtractData("Page")

'Display the extracted data
For i = 1 To Results("Item").count
Write "<P><B>" & Replace( _
Results("Item")(i)("TitleRegion")(1)("Title")(1), _
vbCrLf, "") & "</B>" & vbCrLf
Write "<LI>Name: " & Results("Item")(i)("Name")(1) & vbCrLf
Write "<LI>Description: " & Replace( _
Results("Item")(i)("Description")(1), _
vbCrLf, "") & vbCrLf
Write "<LI>Rating: " & Results("Item")(i)("Rating")(1) & vbCrLf
Write "<LI>Size: " & Results("Item")(i)("Size")(1) & vbCrLf
Next

%>

HTML:

<HTML>
<HEAD>
<META NAME="robots" CONTENT="noindex">
</HEAD>
<BODY TEXT="000000" BGCOLOR="ffffff">

<TABLE>
<TR>
<TH></TH>

<TH></TH>

<TH></TH>

<TH></TH>

<TH></TH>
</TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/d4017969579e371685256d7400424ba3?OpenDocument">07/31/2003 08:04:08 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">H</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">HELO UP. 7/31 12:35PM (IBM service calls)</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/bb82c3649cb2a0ad85256d730046701c?OpenDocument">07/30/2003 08:49:23 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">H</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">FRO Information</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/e7c7623011adc22885256d6e006d4ac0?OpenDocument">07/25/2003 03:53:46 PM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">H</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">IPA Support</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/806ac47503aabb8985256d6700784b83?OpenDocument">07/18/2003 05:59:46 PM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">H</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">Important! - NDC Reissue Problem</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/a3d249d76dff68b885256d730047f6c7?OpenDocument">07/30/2003 09:06:03 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">M</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">Skip Pay Sent to Clients With Sold Loans UPDATED 7/31</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/f1d928e87819aa1385256d73003b56c3?OpenDocument">07/30/2003 06:48:09 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">M</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">Changes to Key Possibility Cards eff. 8/1</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/89ed2b71dc635f4c85256d6e00681ebe?OpenDocument">07/25/2003 02:57:16 PM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">M</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">UPDATED 07/28: CL3 Payment Posting Delay</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/9399822a1e92bf5285256d6d004b3b8d?OpenDocument">07/24/2003 09:41:44 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">M</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">Check Privacy Inquiry site for 'Do Not Solicit'</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/629650b7857311b085256d73003ff9cf?OpenDocument">07/30/2003 07:38:47 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">L</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">Key Possibilities Manual/Knowlix Updates</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/224d7b31190d103e85256d7200650e44?OpenDocument">07/29/2003 02:23:48 PM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">L</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">Key Education Resources Promotion Underway</FONT></B></TD></TR>

<TR VALIGN=top><TD NOWRAP><IMG SRC="/icons/ecblank.gif" BORDER=0 HEIGHT=1 WIDTH=16 ALT=""><B><FONT COLOR="800000"><A HREF="/specserv/WebTick.nsf/e608ab022feee391852567630064436f/bc7bb6addb8e223185256d2500454c95?OpenDocument">05/13/2003 08:36:55 AM</A></FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP ALIGN=center><B><FONT COLOR="000080">L</FONT></B></TD><TD NOWRAP ALIGN=center></TD><TD NOWRAP><B><FONT COLOR="800000">ViewDirect Rollout Underway in KeyCenters Updated 05/28.</FONT></B></TD></TR>
</TABLE>
</BODY>
</HTML>

Warlockvix

1:19 am on Aug 1, 2003 (gmt 0)

10+ Year Member



OK. I'm getting farther. I figured the first array is calling "Item" (<!-- Begin template.... --> and <! -- End include... -->) and I am presuming this is what triggers the script to start looking for information. I added those items into the first web page, hoping to trigger the script and start it to gather data. I have forced an error:

Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument

/a.asp, line 39

this is line 39:
For i = 1 To Results("Item").Count

I haven't changed the script, just the web page to accomidate the script.