Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7989679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:49:16+00:00 2026-06-04T12:49:16+00:00

As title, my question is how to output (lets say save as a text

  • 0

As title, my question is how to output (lets say save as a text file on server computer or pass the result to some other php function using ajax) all DOM content on a page?

I did some homework, I tried curl can just output all DOM content using “curl http://google.ca > dom.txt”
However, the this approach will not save contents that Javascript generated, in other words, the javascript code will not run.
Another approach is to embed some javascript code into a page and let the page load the website we want to output, then use the javascript code to save all DOM file after everything is loaded.

I am not sure if phantom.js can do such job, if yes, then how to?

Any body can give a detailed answer on how to achieve this?

I am open to any solutions, this program will run on my server to provide service.

Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:49:17+00:00Added an answer on June 4, 2026 at 12:49 pm

    Why not:

    jQuery(document).ready(function($) {
        $.post(
            '/your_filename.php',
            'html='+$("html").html(),
            function(response){
                alert(response);
            }
        );
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry for vague question title. I've got a table containing huge list of, say,
I've updated the title and the text of my original question after gaining more
Question: The generated XML file from an .XSD template produces the output pasted below.
folks I have a output file looks like: Title: [name of component] **garbage output**
This question is a bit of a two-parter. First, the title question. Here's what
The question title is a bit strange because I'm not exactly sure how to
As the question title reads, assigning 2^31 to a signed and unsigned 32-bit integer
Although the question title appears a bit subjective I am sure there is not
OK the question title is vague, but here's the problem. I have a list
I guess the question title sums it up. Is there a time when it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.