Extract Header and Footer From Website HTML
A lot of projects we undertake begin with us copying an existing site’s HTML to use as the foundation for further updates. Whether it be implementing a site into a Content Management System, or maybe someone has lost contact with their existing developer and needs us to clone the site, there are a number of reasons why we find ourselves delving into an existing site’s code.
Once we’ve obtained the HTML, the first step is to always extract the header and footer from the code and move it to a common file such as header.php and footer.php respectively. Depending on the size and complexity of the site this can be quite tricky so I built a tool to help us with this part of the job and wanted to share it in the event others come across this scenario.
Simply enter the website address above and the script will look at the first two pages it comes across. It will then produce the HTML that is common between each and that it assumes is the header and footer.