Rich,
To parse a web page you first grab the content with the <CFHTTP> tag, then "read" the content using the CFHTTP.FileContent variable. In the code below I use the find and len functions to figure out where to start and stop the reading/parsing of the page.
This code works only when the page you are parsing is set up just like the code. Where to start and stop depends on what piece of what page you are trying to parse...if you want the entire page, it lives in the CFHTTP.FileContent variable returned by the <CFHTTP> call. The online help in CF Studio is worth a read to understand the <CFHTTP> tag.
<!---get news item for today from somewebsite.com--->
<cfset TodayIS = DateFormat(Now(), 'dddd')>
<cfset YesterDayWas = dateFormat(Now(), 'd')-5> <cfset YesterDayWas = dateFormat(YesterDayWas, 'dddd')>
<cfhttp method="get" url="http://www.somewebsite.com" resolveurl="Yes">
<cfset Start = find("#TodayIS#", cfhttp.FileContent)>
<cfset Headline = Right(CFHTTP.FileContent, (len(CFHTTP.FileContent)-Start)-23)>
<cfset Stop = Find("#YesterDayWas#", Headline)>
<cfset Headline = Left(Headline, Stop-20)>
Craig,
PK Interactive Inc. NY, NY 10001 212.273.9623
-----Original Message----- From: ibtoad [mailto:ibtoad@punkass.com] Sent: Saturday, December 16, 2000 10:48 AM To: CF-Talk Subject: Parsing??
Can anyone tell me where I can find out how to parse a webpage and pull out specific information? I have never done this before.
Thanks, Rich