Hi,

I can not get the regular expression below to work.  Basically, I store a
snippet of HTML that directly precedes the price
on an HTML page as the Start Expression and a snippet of html directly after
the price as an End Expression.  The
price should be what is in the middle.  I am basically copying the code from
Ben Forta's advanced coldfusion book
on the last page of his "Intelligent Agent" chapter.  Basically, it doesn't
find anything and the array values are all
equal to zero ... which means it can't parse out the price or
recognize/match the regular expression.  I've included
the cf script as well as an example of the html that is parsed ....   Does
anyone see what the problem is?  Thanks, Ed
<HTML>
<!--

    File:                       get_price.cfm
        Arguments:
        Called by:                              cold fusion scheduler
    Author:                     Ed Dunn
    Version:                    0.1
    Last modified:              May 30, 2000

   Get pricing data for product.datafeed_method = URL

-->

<HEAD>
<title>Get Pricing</title>
</HEAD>
</BODY>
<!--- Retrieve Products that need prices updated from URL/Web --->
<cfquery name="ProductUrl" datasource="SportsRev" dbtype="ODBC">
Select product_merchant.purchase_url, product_merchant.price_search,
product_merchant.price_search_end, product_merchant.price_search_exact_match
from product_merchant where
product_merchant.datafeed_method = 'URL'
</cfquery>


<CFOUTPUT QUERY="ProductUrl">
<!-- retrieve URL/web page that product is purchased from -->
<cfhttp method="GET" url="#purchase_url#"></cfhttp>
<!--Extract Price-->

<CFSET Get = ReFindNoCase(StartText&'([^'&EndText&']*)'&EndText,
cfhttp.FileContent, 1, 'True')>

#StartText#<BR>
#EndText#<BR>
#get.pos[1]# <BR>
#get.len[1]# <BR>
#get.pos[2]# <BR>
#get.len[2]# <BR>
</CFOUTPUT>
</BODY>
</HTML>

The HTML to be searched:
<FONT size="2">GBB HAWKEYE WD GRAPH</FONT>
</td>
<td align="right" valign="center" width="104" height="1">
              per&nbsp;unit&nbsp;<br>
            </td>
            <td align="right" valign="center" height="1">
              <strong>
                <font color="#FF0000">
    $399.95<br>


where the start expression pasted in the database is:
<FONT size="2">GBB HAWKEYE WD GRAPH</FONT>
</td>
<td align="right" valign="center" width="104" height="1">
              per&nbsp;unit&nbsp;<br>
            </td>
            <td align="right" valign="center" height="1">
              <strong>
                <font color="#FF0000">

and the end expression is:
<br>

I want to extract the $399.95 from the web page using my above reg
expression but it doesn't work.

------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to