You could probably also do this with JavaScript. But to do it with your
ColdFusion example, you just need to process the results.
Assuming the code you provide is correct and returns the desire result.
<cfhttp method="post" url="http://countycat.mcfls.org/search/a?a">
<cfhttpparam type="Formfield" value="Y" name="searchtype">
<cfhttpparam type="Formfield" value="golf" name="searcharg">
<cfhttpparam type="Formfield" value="1" name="searchscope">
<cfhttpparam type="Formfield" value="D" name="SORT">
</cfhttp>
Just add this.
<cfoutput>#cfhttp.FileContent#</cfoutput>
<cfdump var="#cfhttp#">
If you add a result="foobar" to the cfhttp tag, you can do this.
<cfoutput>#foobar.FileContent#</cfoutput>
<cfdump var="#foobar#">
This is how cfhttp works. It does not return the results to the output
stream, it returns the results to a variable that you then need to
process to do what you wish with it. Lots of people don't want all the
results sent to the output stream. They will further process them to
get just some desired pieces.
> I understand your point. The result I am looking for would be to EMULATE what
> would happen in example 1 (as if the user pressed submit on the form and got
[quoted text clipped - 6 lines]
>
> The objective is to get the exact same result in example 1.
Thanks very much Ian.
I added resolveurl=yes to pickup images, etc. and it worked like a charm.
The only (minor) issue I have left is the shopping cart links don't get
resolved correctly. I think this is because the source code on THEIR website
uses JavaScript (onclick). Any way around that one?
Here is the "new" code...
<cfhttp url="http://countycat.mcfls.org/search/a?a" columns="a" method="post"
resolveurl="yes" >
<cfhttpparam type="url" value="http://countycat.mcfls.org/search/a?a"
name="search">
<cfhttpparam type="Formfield" value="Y" name="searchtype">
<cfhttpparam type="Formfield" value="golf" name="searcharg">
<cfhttpparam type="Formfield" value="1" name="searchscope">
<cfhttpparam type="Formfield" value="D" name="SORT">
</cfhttp>
<cfoutput>#cfhttp.FileContent#</cfoutput>
<cfdump var="#cfhttp#">
Ian Skinner - 31 Jul 2006 20:04 GMT
Not an easy one. cfhttp just returns the string of the request. I
would expect if the javascript was emebed in the HTML they would still
work. But most likely, the javascript is in another file. You would
need to make other cfhttp requests to get each javascript file that is
linked. Then do something with them to make them available to your
local copy of the HTML. Possible but problematic.
Now if the javascript is simple enough and|or you are motivated enough,
you may be able to do something yourself. You would have to parse
through the string returned by cfhttp.filecontent and process it in a
similar manner that would happen if the JavaScript was running in a
javascript aware browser.
PS. You probably don't want the <cfdump ...> tag in there forever. I
just put it in to show you all the information returned in the cfhttp
structure.
> Thanks very much Ian.
>
[quoted text clipped - 17 lines]
> <cfoutput>#cfhttp.FileContent#</cfoutput>
> <cfdump var="#cfhttp#">
Ian Skinner - 31 Jul 2006 20:04 GMT
Not an easy one. cfhttp just returns the string of the request. I
would expect if the javascript was emebed in the HTML they would still
work. But most likely, the javascript is in another file. You would
need to make other cfhttp requests to get each javascript file that is
linked. Then do something with them to make them available to your
local copy of the HTML. Possible but problematic.
Now if the javascript is simple enough and|or you are motivated enough,
you may be able to do something yourself. You would have to parse
through the string returned by cfhttp.filecontent and process it in a
similar manner that would happen if the JavaScript was running in a
javascript aware browser.
PS. You probably don't want the <cfdump ...> tag in there forever. I
just put it in to show you all the information returned in the cfhttp
structure.
> Thanks very much Ian.
>
[quoted text clipped - 17 lines]
> <cfoutput>#cfhttp.FileContent#</cfoutput>
> <cfdump var="#cfhttp#">
Ian Skinner - 31 Jul 2006 20:04 GMT
Not an easy one. cfhttp just returns the string of the request. I
would expect if the javascript was emebed in the HTML they would still
work. But most likely, the javascript is in another file. You would
need to make other cfhttp requests to get each javascript file that is
linked. Then do something with them to make them available to your
local copy of the HTML. Possible but problematic.
Now if the javascript is simple enough and|or you are motivated enough,
you may be able to do something yourself. You would have to parse
through the string returned by cfhttp.filecontent and process it in a
similar manner that would happen if the JavaScript was running in a
javascript aware browser.
PS. You probably don't want the <cfdump ...> tag in there forever. I
just put it in to show you all the information returned in the cfhttp
structure.
> Thanks very much Ian.
>
[quoted text clipped - 17 lines]
> <cfoutput>#cfhttp.FileContent#</cfoutput>
> <cfdump var="#cfhttp#">