Webarchive and Terminal question

Hi all,

I recently tried to convert a .webarchive file to the constituent html and images. To do so I used the following command:textutil -convert html <<path to webarchive>>

<hr size=2>

Essentially, I am trying to convert the webarchive to an html file via terminal. The only problem is that it didn't work. Does anyone have a solution to this?

<hr size=2> Thanks for any help
God Bless


iBook G4 Mac OS X (10.4.6)

Posted on May 8, 2006 11:48 AM

Reply
3 replies

May 9, 2006 2:50 AM in response to followerofChrist

Hi, followerofChrist.

It appears the textutil conversion only works well if the source Web page uses relatively simple HTML. I performed the following experiment:

1. In Safari, created a Web archive of the Google Home page, a page known for its simple appearance and low-graphics content.

2. Used textutil to convert the Web archive as you described,which produced one HTML file and a .gif file for the Google logo.

3. Opened the HTML file: it bore no resemblance to the Google home page: the logo did not display, the search field was not shown, and some elements were out of place.

4. Compared the source code of the Google home page to the converted page. One can view the source code for a Web page in Safari using either View > View Source or the Command-Option-U keyboard shortcut.

The comparison showed significant differences. In particular, the Google Home page depends on a script which is not included in the conversion from Web archive via textutil.

Therefore, I suspect textutil will give one a pretty good conversion if the page in the Web archive is basic HTML, but once advanced Web features come into play — such as Javascript, CSS, Java, etc. — then the conversion won't be satisfactory. In other words, this appears to be a limitation in the deign of textutil.

Hope that helps.

Good luck and God Bless!

😉 Dr. Smoke
Author: Troubleshooting Mac® OS X

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Webarchive and Terminal question

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.