0

ok I am kinda dumb so let me try to make sense

I am trying to do the following
1) I want to read an html file (Done invoked CFHTTP)
2) find a value in the file which is embedded between a <li>eg <li class=class>Value I am looking for </li> (Think I kinda got this part.
3) Now this is where it gets difficult for me, there are at any given time a random number of values between the <li> </li> I may have 12 <li> </li> today and 5 tmrw etc

I want to be able to read those values assign them a specific value then pass them to a file

eg:

<CFHTTP URL='http://127.0.0.1/file.htm' METHOD='GET' RESOLVEURL='yes'></CFHTTP>
<cfset start = FindNoCase('<li class=class>' , cfhttp.FileContent)+9>
<cfset strLength= FindNoCase('</li>' , cfhttp.FileContent)-start>
<cfset value = mid(cfhttp.FileContent,start,strLength)>


The problem is I want to be able to repeat that step and to have a unique value for each new instance where a value is found between the <li> and </li>


please help me guys.

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by l14n
0

Hi

Reply if this code is of any use for you.

<cfset test_data = "string variable having li tags">

<cfset test_data = Replace(test_data, "<li class=class>", "$@*","all")>
<cfset test_data = Replace(test_data, "</li>", "$@*","all")>

<cfloop list="#test_data#" delimiters="$@*$@*" index="item">
<cfoutput>#item#</cfoutput><br />
</cfloop>

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.