开发者

How to parse a HTML file at a URL?

开发者 https://www.devze.com 2022-12-22 01:14 出处:网络
I am new to iphone development.I am able to parse a Xml file at a URL and retrieve it contents fr开发者_C百科om a particular nodes.

I am new to iphone development.I am able to parse a Xml file at a URL and retrieve it contents fr开发者_C百科om a particular nodes.

For Parsing at url

 NSString * path = @"xxxxxxxxxxxxxxxxxxxxxx";
    [self parseXMLFileAtURL:path];

For retrieving the data i use NSXMLParser .How can i achieve the same thing if i have HTML file at my URL(Source code of the webpage is HTML).Please help me out.Thanks.


You can't parse HTML with NSXMLParser, unless if you want parse it markup by markup.

However it exists some library to do this like the libxml2. You can find a mini tuto here: How to Parse HTML

You can also find more information about it at another topic: parsing HTML on the iPhone

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号