Seth,

Thanks for the tip.  I will adapt it and give it a try.   I will find the
URL page.  Then check to see if this is a NOT FOUND page (custom tag call)
and then start getting the other pieces of data I need (custom tag call).

Phil


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Seth Bienek
Sent: Tuesday, October 02, 2001 12:36 PM
To: [EMAIL PROTECTED]
Subject: RE: Need help. Need to screen scrape (parse) - Need examples



Hi Philip,

> Has anyone made a generic routine to retrieve designated URLs & the
> beginning strings to search for and save N characters after that?

Here's an example of how you would do something like this with a custom tag.

This custom tag would take 3 required attributes, "URL", "Find", and
"StringLen"...  By the way, it's something I just threw together quickly, so
no guarantees that it is error-free.. And it would need lots of
error-checking in place before being ready for prime time.. But it should
give you an idea of the principles involved.

<!--- Get the target page --->
<cfhttp url="#Attributes.URL#" resolveurl="no"></cfhttp>

<!--- Use regular expression to exclude any HTML Markup --->
<cfset GrabbedPage = REReplaceNoCase(cfhttp.filecontent,  "<[^>]*>", "",
"ALL"))>

<!--- Find text passed in via custom tag attribute "find" --->
<cfset StartPosition = FindNoCase(Attributes.Find, GrabbedPage)>

<!--- Return "Stringlen" number of characters starting with "find"
position --->
<cfset GrabbedPage = Mid(GrabbedPage, StartPosition,
val(Attributes.StringLen))>

<!--- Returned parsed text to the calling page --->
<cfset ThisTag.GeneratedContent = GrabbedPage>


Hope it gets you headed in the right direction.

Take care,

Seth
"The poet is in command of his fantasy, while it is exactly the mark of the
neurotic that he is possessed by his fantasy."  -Lionel Trilling, The
Liberal Imagination (1950)
-----------------------------------
Seth Bienek
Digitaris Technologies, Inc.
tel (972) 690-4131, ext. 103
fax (972) 690-0617
icq 7673959
-----------------------------------



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to