I would like to know if it is possible to save only a part of a web page as HTML after it is finished rendering.
Let’s say I have a web page, on this web page there is a tile view. This tile view is a UL list with an ID.
After this finishes loading, I would like to save away only this UL list as an HTML file, so that the next time I load the page, under defined circumstances, I load/output this HTML file and don’t have to do the "tiling" functions.
I have already found this, how to generally save a page as HTML
https://stackoverflow.com/a/3775302/11813184
But unfortunately nothing about whether I can also save away only a certain area, such as a UL list with a defined ID.
2
Answers
Try to use SimpleHTMLDom library for your needs – https://simplehtmldom.sourceforge.io/manual.htm
This is like jQuery, but for PHP.
I have used successfully
ob_start
andob_get_contents
as they are described here. Save current page as HTML to server