Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
Python script that downloads complete webpages with all assets for offline viewing, preserving structure and style.
Website Cloner is an open-source Python command-line tool that downloads a complete webpage — HTML, CSS, JavaScript, images, and other linked assets — into an organized local folder for offline viewing.
Website Cloner is a Python 3 script that takes a URL as input and produces a local mirror of the page and its assets. It runs from the command line, requires the requests library, and is hosted on GitHub under the zebbern repository. It preserves the original HTML structure and formatting, rewrites internal links to point to local files, and saves everything into a folder named sites/domain_name/.
@import statements and url() references inside stylesheets, downloading referenced fonts or images.sites/domain_name/, using the URL's domain and path to build the folder structure.python clone.py https://example.com/login.Website Cloner is built for developers and researchers who need to work with web pages offline. Web archivists can save a snapshot of a page with all assets for long-term preservation. Front-end developers can download a reference implementation to study how a site's HTML, CSS, and scripts are structured. Security researchers and red-teamers may use it to create realistic lookalike pages for authorized testing, though the README emphasizes that users must respect terms of service and copyright law.
The script first downloads the main HTML file while preserving its exact structure. It then parses the HTML with regular expressions to find resource links, downloads all CSS stylesheets, processes their internal URLs, downloads images and JavaScript files, and finally rewrites all links to point to the local copies. The entire clone is stored in an organized folder structure.
Yes, the repository is open source and free to use. It requires Python 3.6 or newer and the requests library.
It attempts to clone any public URL, but sites that require login, use heavy JavaScript rendering, or block non-browser user agents may not download completely. The script uses Firefox-compatible headers to reduce the chance of being blocked.
Website Cloner requires Python 3.6 or later. You also need to install the requests library and have an active internet connection.
The README's disclaimer says the tool is intended for legitimate purposes such as web archival, research, and backup, and that users are responsible for respecting website terms of service and copyright laws.
After running the script, host the generated folder with a local web server, for example python -m http.server 8000 --directory /mirror_https_github.com_login, then open http://localhost:8000/ in your browser.