Proper Use of JSON [closed]
Is it proper to parse through multiple HTML files in Python (Beautiful Soup), and then store the information in JSON format which will be iterated in Objective-C? If not, how should I format it? (I.e. XML, SQL, etc.?)
Thanks!
Edit: The situation I am dealing is the same as my previous question (although a different aspect is being discussed). https://stackoverflow.com/questions/6836836/good-organization-for-a-book-app-with-scraped-data
As others have said, your question is vague, but what you're proposing is a perfectly reasonable way of solving your problem as I understand it. I think what you're actually asking is what the best way of storing and loading your data is.
There's nothing wrong with using JSON per se, but it may not be particularly well-suited to what you wish to accomplish. It sounds like you're dealing with documents, and XML is generally preferred for documents. JSON is designed to be a "lightweight data-interchange format," whereas XML is designed specifically specifically for encoding documents. XML will make your life much easier if you need to store and parse formatting information, for instance.
There are a number of XML parsers available for iOS, and I assume there are plenty of options for JSON parsing as well.
To be honest, I'm a little confused as to why you can't simply display the original HTML documents. If you update your question with more information about the specifics of what you're trying to do, I may be able to provide better information.
精彩评论