Search code examples
web

How can I download the page source from the website directly?


Someone asked me to do a few changes on their business website but they don't have the source code and they don't remember who developed website to ask from him. Is there a way I can clone the website(Download the source code) and do the changes then publish it with a new domain and server.


Solution

  • Front-end code is available directly in the browser. If it's a single-page site, you can literally right-click > Save As > Webpage, Complete to download all the relevant files. If it's a multi-page site, you can use a web scrapper (e.g. Beautiful Soup) to programmatically crawl and download each page.