开发者

How to get the attributes inside a tag in an html file on iOS?

开发者 https://www.devze.com 2023-03-16 17:58 出处:网络
Here is my link i want to extract the youtube videos out from the html at this URL http://gdata.youtube.com/feeds/api/users/mizzoushape/uploads?orderby=updated

Here is my link i want to extract the youtube videos out from the html at this URL

http://gdata.youtube.com/feeds/api/users/mizzoushape/uploads?orderby=updated

$<link rel ='alternate' href='somelink.html'/>$

Can any one help me out how to fetch the attributes inside the tag..

Thanks in advance for your va开发者_JAVA技巧luable time


If you are parsing XML File Then:

In the parser:didStartElement method, the attributes are stored in the attributeDict dictionary. The values are then stores with the attribute name as the key

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qualifiedName  attributes:(NSDictionary *)attributeDict{

// Here you can get value from "attributeDict" by key for example
NSString *strHref = [attributeDict objectForKey:@"href"];

}
0

精彩评论

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