Это может быть простой вопрос, но я не могу получить точные данные из приведенной ниже строки.Следующие данные я хочу извлечь, но не могу этого сделать.1. Описание 2. Когда текст 3. Где текст 4. Нажмите здесь ссылку
Как мне преобразовать это в цель C.
<p>
<a href="http://feedads.g.doubleclick.net/~a/uD33rOAaHkAZywKvO6ntrkv_ETU/0/da">
<img src="http://feedads.g.doubleclick.net/~a/uD33rOAaHkAZywKvO6ntrkv_ETU/0/di" border="0" ismap="true"></img>
</a>
<br/>
<a href="http://feedads.g.doubleclick.net/~a/uD33rOAaHkAZywKvO6ntrkv_ETU/1/da">
<img src="http://feedads.g.doubleclick.net/~a/uD33rOAaHkAZywKvO6ntrkv_ETU/1/di" border="0" ismap="true"></img>
</a>
</p>
<p>
<a href="http://mumbai.burrp.com/events/little-theatre-ncpa_semshook_nariman-point_mumbai/19313517316">
<img src="/images/evt/c/6/photo_little-theatre-ncpa_nariman-point_mumbai@c6s6kwyg_2wat_1_300.jpg"/>
</a>
</p>
<p>
Tenzin is a Tibetan born and raised in India. Yearning to explore his true homeland, he impulsively hops on his motorcycle and embarks on a personal quest: to find his identity and discover the indescribable beauty and wonders of his magnificent homeland. But Tibet is a nation under siege from a repressive regime. While Tenzin encounters friendship, camaraderie and even love along the way, he cannot escape the horrors of a political world he wants no part of. Looking only for the way to peace, both within himself and for the land he loves, Tenzin must find the courage to pursue the truth, even if it means facing terrible dangers to find his Semshook.
<strong>Language</strong>: Hindi, English, Tibetan Film with English subtitles
<strong>Directed by</strong>: Siddharth Anand Kumar
<strong>Cast</strong>: Tenzin Younden, Tenzin Choedon and Tensin Woebhum
</p>
<p>
<strong>When:</strong> Friday Feb, 24
</p>
<p>
<strong>Where:</strong> Little Theatre (NCPA), Nariman Poin
</p>
<p>
<a href="http://mumbai.burrp.com/events/index.html">More events</a> in Mumbai
</p>
<p>
<a href="http://mumbai.burrp.com/events/date/this-weekend">Click Here</a> to view more events happening <strong>this weekend</strong> in Mumbai
</p>
Я использовал этот код, но это дает мне простоетекст, я хочу, чтобы ссылка, связанная с этим текстом, означала как комбинацию текста и ссылки.
NSScanner *theScanner;
NSString *text = nil;
theScanner = [NSScanner scannerWithString:html];
while ([theScanner isAtEnd] == NO) {
[theScanner scanUpToString:@"<" intoString:NULL] ;
[theScanner scanUpToString:@">" intoString:&text] ;
html = [html stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>", text] withString:@""];
}
//
html = [html stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSLog(@"html======================>%@",html);
return html;