•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 456,565 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,577 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 1660 | Replies: 1
![]() |
•
•
Join Date: Sep 2007
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 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.
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.
•
•
Join Date: Jan 2008
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 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>
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>
![]() |
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- vBulletin mod_rewrite (PHP)
- filling variable with array from vb code. (HTML and CSS)
- Giving records in MS Access unique numbers (MS Access and FileMaker Pro)
- Retreiving a Variable from a URL (PHP)
- Dialog Box alongwith Form (Visual Basic 4 / 5 / 6)
- Can draw one Frame in a variable? (Java)
- i want the user to enter an input without obligating him to press enter (C++)
- Pipe inside variable isn't working in bash (Shell Scripting)
- C++ Syntax (C++)
Other Threads in the ColdFusion Forum
- Previous Thread: Xml To Query
- Next Thread: Cfinclude Link Help


Linear Mode