I'm trying to download the specified web pages with their inner page resources to disk. When I send a NSURLRequest, only the initial URL would be request, but the resources as images,css,js would not be download.
Someone suggests to use cache, but I don't want to cache every web page browsed in the uiwebview, but only the one I specified.For example, when I input an url to the uiwebview addressbar then click on the "save" button, the page will be saved entire, but the other browsing in the webview will not be cached automatically.
Does there any way to download the entire webpages? Thank you very much!
I ran in the same problem once, and I solved it using ASIWebPageRequest . It was old by the time, but still works.
I wrote a method (based on sample method) for download a webpage in a folder. You need to modify this to get it work.
}
I used ASIDownloadCache too.
You could implement a custum NSUrlCache and save everything. Everything that is downloaded using a NSUrlRequest will use the NSUrlCache. Everything a UIWebView does uses the NSUrlRequest. If you need a sample, then have a look at https://github.com/evermeer/EVURLCache