1

I had been tried this library: https://github.com/stake/STWebArchiver It's good, but if I access some web pages isn't well-formed, it would not be saved.

So, is there any way for me to try to save web page(s) as .webarchive on iOS devices? Could somebody give me some advices?

Thanks a lot!

徐赫謙
  • 70
  • 8

2 Answers2

4

You cannot. UIWebView is not equal to the WebView class in Mac OS X. I recommend you try ASIWebPageRequest.

Pripyat
  • 2,937
  • 2
  • 35
  • 69
-1

For Webpage not well formatted, the libxml parser(which is the original STWebArchiver using) is not a good solution. So I update STWebArchiver with Regular Expression like this

NSArray *pathsForImagesAndScripts = [self extractResourcesWithHTML:htmlContent regex:@"<(?:script|img).*src=[\"']((?!data:).*?)[\"']"];

checkout: this

Foster Yin
  • 80
  • 3