我需要获取标记<span></span>
HTML代码截图:screencast.com
但解析后我得到以下一行:
Xcode调试器屏幕截图:screencast.com
为什么会这样?是否有可能获得内容?
Сode示例:
NSURL *tutorialsUrl = [NSURL URLWithString:@"http://people.onliner.by/2014/04/29/voda-2/"];
NSData *tutorialsHtmlData = [NSData dataWithContentsOfURL:tutorialsUrl];
TFHpple *tutorialsParser = [TFHpple hppleWithHTMLData:tutorialsHtmlData];
NSString *tutorialsXpathQueryString = @"//div[@class='comment-actions']/a/span";
NSArray *tutorialsNodes = [tutorialsParser searchWithXPathQuery:tutorialsXpathQueryString];
for (TFHppleElement *element in tutorialsNodes) {
_code = [element content];
}