?
Solved

parse dynamic site and save as html files

Posted on 2006-06-08
8
Medium Priority
?
194 Views
Last Modified: 2013-12-24
I need to find a way to parse a coldfusion site on another server and save all the source code as .html files. I am trying to backup an old site that was generated out of a cms program as a static html site or even into text files. Does anyone know hoe to do something like this?
0
Comment
Question by:siva350
  • 4
  • 4
8 Comments
 
LVL 3

Author Comment

by:siva350
ID: 16865011
Let me clarify myself, I dont need the cf source code just the code generated out that you would see if you did a view source.
0
 
LVL 7

Expert Comment

by:aseusainc
ID: 16865016
The only way to get the CF source code is locally at the site itself.  If you view pages from a web browser or even by using a <cfhttp> tag, you are seeing post-processed code.
0
 
LVL 7

Expert Comment

by:aseusainc
ID: 16865050
Posted above as you were posting.

Yes, in that case, just use a <cfhttp> tag coupled with a <cffile> tag to save it as a text file.

<CFHTTP
    URL = "http://your.web.address"
    resolveurl = 1
    throwonerror = Yes>

<CFFILE ACTION="Write"  
    FILE="c:\some_path\saved_output.html"
    OUTPUT="#cfhttp.filecontent#">


I think something like this should work...
0
How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

 
LVL 7

Expert Comment

by:aseusainc
ID: 16865080
Just for fun, I actually tested the above code, it works like a charm :)
0
 
LVL 3

Author Comment

by:siva350
ID: 16865098
How would I make it crawl the site and make it generate out all the pages into files? The pages are all called by variables in the links.
0
 
LVL 7

Accepted Solution

by:
aseusainc earned 2000 total points
ID: 16865193
You'd have to parse out the #cfhttp.filecontent# looking for more external links.  Then best bet would probably be add them to a list until you get to the end of the document, then start over again from the 1st element of your list, all the while looping over your list to make sure you dont add any duplicates (otherwise you'll end up in an endless loop).

Why not just go download a web crawler that will save the output if thats all you need to do?  I'm sure there are tons if you Google it.
0
 
LVL 3

Author Comment

by:siva350
ID: 16865360
Aseusainc I like what your saying with the loop but I think you are correct about finding a web crawler do handle it for me. I will look around and If I get it to work I will be back with your points. Thanks again for your help.
0
 
LVL 3

Author Comment

by:siva350
ID: 16865880
Well it seems to have worked good enough, thanks!
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question