The simplest thing I can think of is to open the file you want to save as source code, which you can do from Chrome Android by prepending view-source to the URL, like so.
view-source:https://my-site.tld/xxx/my_page.html
You can then either copy and paste this code into a local file, or use the share button to open it with a compatible app of your choosing.
If this seems like too much of a pain, you might consider doing something like using PHP to determine whether the file should be viewed or downloaded. For example if the IP address of the request matches your phone, download instead of displaying the file.
<?php
/**
* File url: https://my-site.tld/xxx/my_page.php
*
*/
$remote_address = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_STRING);
if ($remote_address === '56.57.58.59') {
header("Content-Disposition: attachment; filename=\"filename.html\"\n");
header("Content-Type: text/html\n");
}
?>
<!-- Begin actual page content -->
<!DOCTYPE html>
<html lang="en-US">
<meta charset="UTF-8">
....
Conversely, you could also simply create a separate page to allow a download regardless of the requesting IP address.
<?php
/**
* File url: https://my-site.tld/xxx/my_page-download.php
*
*/
header("Content-Disposition: attachment; filename=\"filename.html\"\n");
header("Content-Type: text/html\n");
readfile('path/to/file');
Additional information about the Content-Disposition header may be found in the Mozilla Developer Docs. It's not the only resource, of course, it's just my personal favorite.
The simplest thing I can think of is to open the file you want to save as source code, which you can do from Chrome Android by prepending view-source to the URL, like so.
view-source:https://my-site.tld/xxx/my_page.html
You can then either copy and paste this code into a local file, or use the share button to open it with a compatible app of your choosing.
If this seems like too much of a pain, you might consider doing something like using PHP to determine whether the file should be viewed or downloaded. For example if the IP address of the request matches your phone, download instead of displaying the file.
<?php
/**
* File url: https://my-site.tld/xxx/my_page.php
*
*/
$remote_address = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_SANITIZE_STRING);
if ($remote_address === '56.57.58.59') {
header("Content-Disposition: attachment; filename=\"filename.html\"\n");
header("Content-Type: text/html\n");
}
?>
<!-- Begin actual page content -->
<!DOCTYPE html>
<html lang="en-US">
<meta charset="UTF-8">
....
Conversely, you could also simply create a separate page to allow a download regardless of the requesting IP address.
<?php
/**
* File url: https://my-site.tld/xxx/my_page-download.php
*
*/
header("Content-Disposition: attachment; filename=\"filename.html\"\n");
header("Content-Type: text/html\n");
readfile('path/to/file');
Additional information about the Content-Disposition header may be found in the Mozilla Developer Docs. It's not the only resource, of course, it's just my personal favorite.
You can copy the html raw content (from view-source) into the textarea on this page
https://jsfiddle.net/o19q5tzy
and press download.
The webpage only contains
<a id="link" href="" download='tmp.html'>download</a><br>
<textarea oninput="link.href = window.URL.createObjectURL(new Blob([this.value], {type: 'plain/text'}))" style="width: 100ch; height: 40ch"></textarea>
I considered it a no-brainer. I was wrong.
I wanted to take along some files to read when I'm out of network reach or in flight mode. The files happen to be quite plain HTML files, no script, just a CSS file defining the simple layout, and that's it. So I copied the HTML and the CSS files onto my phone and tried to open them.
First attempt was from a file manager. It told me that it no idea what to do with an HTML file. I then tried to look for an "open file" entry in Chrome. Nope. Same in Firefox. Then I tried to force-open the files by using a file:///path/to/file style URL - and it actually submitted the whole string to Google as a search string, as if Chrome (and Firefox) had been lobotomized of the file: protocol.
Now I'm at a loss - is there no way to open a simple HTML file on an Android 13 phone?
Videos
You can use a local server to host the webpage, and navigate to the private IP of your pc from your mobile device if they are connected to the same network.
I prefer live-server npm package for this. Simply type npm install -g live-server. Navigate to the directory your website is located at then run live-server. It will also show the port you are running on.
To find out your private ip address, open another command line and type ifconfig (or ipconfigif you are on windows).
Navigate to ip-address:port-number in your mobile device and you will see your website. Example private ip address and port number: 192.168.1.40:8080
The easiest way for previewing on the mobile device is using websites such as : https://search.google.com/test/mobile-friendly? I hope this helps you to determine your problem.
Essentially, what you'll need to do (and what my app mentioned below does) is go over all the references links to additional additional assets / images / scripts and so on, download them, and then change the HTML document to point to the local downloaded copy. Something like this, with Jsoup:
Find all the
imgelements on the page,Get the location / url of the image file from the src attribute of the
imgelements (with.attr("abs:src:)),Download all of those images to a local directory
Change each of the image elements src attribute values to point to the location of the downloaded image file, relative to where the main HTML file will be stored, eg with
.attr("src", "assets/imagefilename.png"").Do this for all other assets required by the page, eg. images, CSS, scripts, html5 video, and others. I also did some regex on the CSS (both linked and inline) to extract, download, and rewrite things like background image references and in the css. Webpages also have other linked things like favicons or RSS feeds which you might want too.
Save your Jsoup document (with the modified URLs pointing to your downloaded versions of the assets) to file, by calling
.toString()on it and saving the result to a file.
You can then open the local HTML file in webview, and, assuming you have done everything right, it will show with all images and assets, even offline.
I actually wrote an Android app which does exactly this: save a complete HTML file and all of the CSS / images / other assets to a local file / directory, using Jsoup.
See https://github.com/JonasCz/SaveForOffline/ for the source, specifically SaveService.java for the actual HTML page saving / downloading code.
Beware that it's GPL licensed, so you have to comply with the GPL license if you use (parts of) it.
Also beware that it does a lot of things, and is quite messy as a result, (there's also no comments or documentation either...) but it may help you.
You can do it with Jsoup. IMO, it's a lot of work. On the other, you can consider Crawler4j.
There is a tutorial on their website. Have look to the example for crawling images.
In Chrome for Android, you can save the opened web page as a PDF. To do that, you have to install the Google Cloud Print application to do this.
Once you have installed it, first open a desired web page in Chrome.
Then, click on the menu icon and select on Print option. There, you can select the Save as PDF option.
Select the location and click on the save button. This should save a PDF of the current web page which you can read by using any PDF viewer that came with your smartphone.

You can save as PDF on Firefox too. Just go to Menu -> Page -> Save as PDF
![]() |
![]() |
|---|
How can I download HTML?
Hello! I just finished the HTML and css course on codecademy and want to start writing it on my own now. I have been trying to figure out how to get html on my computer and based off what I found online I used notepad to write my code, but I don’t like how it doesn’t give those error notifications. I also used sublime text but for some reason it’s not working (probably my code but idk it works with notepad). I’ve done Java and Python before and I’m starting to think getting HTML on my computer probably isn’t the same process as getting java. Do I have to download CSS separately? Ik these are pretty basic questions lol but if someone could help me out with getting html (and maybe CSS 😳) on my computer(windows) I would really appreciate it!
So I am currently trying to download all of my memories from my Snapchat account. My main reason is my dog is ill and may not be around longer, so I want to get the videos of her off of it for safe keeping.
I requested my Snapchat data and they sent an HTML file with a download link for every memory. I managed to get each link on its own line in a .txt file. I tried using Python to extract each link from the text file to a table and download every file automatically, so I wouldn't have to click download 1,000+ times. However, when the link is opened, it shows "Error: HTTP method GET is not supported by this URL".
I have no experience with HTML, JS, or any web development, only Lua and Java. Is there a tool already in existence I could use to download from every link? I know this question may be a bit unconventional, so I appreciate any help.
Thank you.



