Save current page as HTML to server

后端 未结 6 1809
一生所求
一生所求 2020-11-29 19:05

What approach could someone suggest to save the current page as an HTML file to the server? In this case, also note that security is not an issue.

I

6条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-29 19:29

    In case you are looking to save complete html page along with css, images and scripts in a single html file, you can use this class I have written:

    This class can save HTML pages complete with images, CSS and JavaScript.

    It takes the URL of a given page and retrieves it to store in a given file.

    The class can parse the HTML and determine which images, CSS and JavaScript files it needs, so those files are also downloaded and saved inside the HTML page saved to a local file.

    Optionally it can skip the JavaScript code, keep only the page content, and compress the resulting page removing the whitespace.

    http://www.phpclasses.org/package/8305-PHP-Save-HTML-pages-complete-with-images-CSS-and-JS.html

提交回复
热议问题