Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

GooseInTheCaboose

macrumors 6502
Original poster
Apr 2, 2022
356
199
Hello-
I’m doing a research project and my associate needs me to save some (actually, a LOT of) webpages as HTML files because those are the format he needs to analyze them.

Command-Shift-S in Safari on iPad Pro unfortunately will not yield an HTML file.

Is there any way to efficiently save webpages as HTML files on iPad Pro?

I will use any browser, and extensions, if that’s possible on iPad Pro. (m2 11”). Ideally, after it is set up, I would like to be able to do this quickly as I may need to save close to 100 or more pages.
 
With unix/Linux there's the "curl" command that can grab files from web URL's. This is easy on a Mac using the unix command line in Terminal. But, of course, you're on an iPad! A quick search found this which may do what you want, but not clear if it lets you save the output. Worth looking at maybe?


But there's another approach that worked for me. The ish app gives you a Linux-like environment on iOS and iPadOS.


I have it on my phone but have only played around with it a bit. Should work the same on the iPad though. Using ish, I installed the curl package:

apk add curl

First time I tried, it failed and wanted permission to access my local network. After granting that, it worked on the second try. You would use a command such as this to display a page (obviously a made-up example)

Code:
curl https://somewebsite/homepage.html

But that will just display the page source as text and not save it. To save it on your iPad, direct the output to a file like this

Code:
curl https://somewebsite/homepage.html > webpage.txt
Again, just made up a filename. I chose to use the .txt extension because I thought using .html might make it open in a browser? But you could certainly use .html instead. In terms of unix/Linux files, you don't need any extension at all actually. Since you're using a shell, it would be possible to script the download of multiple pages if you like.

The files are saved in your ish directory. What I'm not sure of is how you would access it with other apps after saving. Pretty sure that's possible, but will leave it to you or someone else more familiar with ish to figure that out.

Having said all this, it also depends on what kind of webpages you want to save. Simply saving the page source may not be enough.
 
Last edited:
You could potentially make something in Shortcuts to do this. I just whipped together a quick prototype that seems to work.

Of course you would need to change this for your specific needs. Could make it show in the Share Sheet and have the URL passed in from Safari, or just dump in a list of URLs to loop through. Would also need to add more actions to save the HTML to a file.

1727799504080.png

Note: There is also a 'Get Contents of Web Page' action, but that seems to get saved as a webarchive rather than an HTML file. I believe the 'Get Contents of URL' action is essentially using CURL, which was mentioned above.

EDIT:
Simplifying this some more... All you really need is the 'Get Contents of URL' action and a save action. You don't need the 'Make HTML' action. I just needed that so I could view the HTML in Quick Look rather than the rendered HTML.
 
Last edited:
You could potentially make something in Shortcuts to do this. I just whipped together a quick prototype that seems to work.

Of course you would need to change this for your specific needs. Could make it show in the Share Sheet and have the URL passed in from Safari, or just dump in a list of URLs to loop through. Would also need to add more actions to save the HTML to a file.

View attachment 2431200

Note: There is also a 'Get Contents of Web Page' action, but that seems to get saved as a webarchive rather than an HTML file. I believe the 'Get Contents of URL' action is essentially using CURL, which was mentioned above.

EDIT:
Simplifying this some more... All you really need is the 'Get Contents of URL' action and a save action. You don't need the 'Make HTML' action. I just needed that so I could view the HTML in Quick Look rather than the rendered HTML.
Oooh thanks! This is creative, elegant, and looks like it will be the winning ticket! I’ll try this later when I get a minute..hopefully not too difficult for a mildly-tech-challenged person like me to implement lol

Is there a way to activate it with a keystroke, pulling the URL from the address bar in safari?

Also are there any differences in the html file that this outputs compared to doing command-shift-s on desktop?
 
Last edited:
Agreed, Shortcuts should be able to help. Perhaps we can make a shortcut for downloading HTML from a list of URLs.

What about these apps? Check them out



 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.