私はiPhone開発に不慣れです.URLのHTMLファイルから特定のコンテンツを解析して取得したい.私はこのリンクからサンプルコードを持っていますhttp://blog.objectgraph.com/index.php/2010/02/ 24/parsing-html-iphone-development/
NSData *htmlData = [[NSString stringWithContentsOfURL:[NSURL URLWithString: @"http://www.objectgraph.com/contact.html"]] dataUsingEncoding:NSUTF8StringEncoding];
TFHpple *xpathParser = [[TFHpple alloc] initWithHTMLData:htmlData];
NSArray *elements = [xpathParser search:@"//h3"]; // get the page title
TFHppleElement *element = [elements objectAtIndex:0];
NSString *h3Tag = [element content];
NSLog(h3Tag);
mLabel.text = h3Tag;
彼らはソースの h3 タグのコンテンツを取得しています。適切に表示されます。お問い合わせください。スタック オーバーフローとして URL を変更し、タイトルを検索しました。タイトルを適切に取得します。しかし、属性のコンテンツを取得できません。タグの