I am writing a program that parses the DOMDocument of a given URL. If I use a WebView, this process takes a very long time. I suspect it is because a WebView will process data for display, even if the WebView is not connected to a window (is this true?). An alternative would be to bypass WebView and retrieve the data as follows:
I now have the data as an NSString. But how can I turn this into a DOMDocument so that I can use the tools provided in the DOM libraries?
Is there a better way to do this?
A related question: What data does "dataWithContentsOfURL:" get? What if there are several files located at the given URL? Does it retrieve them all?
Code:
NSData* nsdata;
nsdata = [NSData dataWithContentsOfURL:[NSURL URLWithString:someURL]];
NSString* myString;
myString = [[NSString alloc] initWithData:nsdata encoding:NSASCIIStringEncoding];
I now have the data as an NSString. But how can I turn this into a DOMDocument so that I can use the tools provided in the DOM libraries?
Is there a better way to do this?
A related question: What data does "dataWithContentsOfURL:" get? What if there are several files located at the given URL? Does it retrieve them all?