There is a DIV block, which is filled with content after the page is loaded with JS. The task is to save the contents by pressing the button in a file on the server. For example
<div class="getcode"> Наполняемый контент, другие div блоки </div> As php means to organize the preservation of internalities, it is a piece of code that is in this block in a file, that is, on the server in a certain daddy put. Html files with the contents of this block.