我需要解析一些网站 - >从这个网站获取一些HTML代码 - >把这段代码放在NSString中 - >
[web loadHTMLString:someNSString baseURL: nil]
;
我该怎么做?
答案 0 :(得分:3)
检查MWFeedParser
,
- (NSString *)stringByConvertingHTMLToPlainText;
- (NSString *)stringByDecodingHTMLEntities;
- (NSString *)stringByEncodingHTMLEntities;
- (NSString *)stringWithNewLinesAsBRs;
- (NSString *)stringByRemovingNewLinesAndWhitespace;
https://github.com/mwaterfall/MWFeedParser/blob/master/Classes/NSString+HTML.m