I have an UITableView and I want to populate it with data from this page: http://tvgids.mobi/gids/ned1.php
My code:
NSURL *urlll = [NSURL URLWithString:[NSString stringWithFormat:url]];
NSString *test = [NSString stringWithContentsOfURL:urlll];
UIAlertView *av = [[UIAlertView alloc] initWithTitle:@"LOL" message:test delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[av show];
[av release];
That part works, but the problem is: How do I get the list of tv programs into an UITableView?
I can’t use an XML parse since the page isn’t valid XML. Every single tv program on that page is written like this (in html):
<div class="v2-listing">
<div class="v2-tijd">13:30</div>
<div class="v2-omschrijving">
<a href="http://tvgids.mobi/vanavond-op-tv/8428198-NOS_Sportjournaal.xhtml" >NOS Sportjournaal</a>
</div>
</div>
I need to get v2-tijd (e.g. 13:30), and the a‘s href (e.g. http://tvgids.mobi/vanavond-op-tv/8428198-NOS_Sportjournaal.xhtml) and content (e.g. NOS Sportjournaal).
How would I do this?
I would probably try using RegExKit or RegExLite to grep out what I needed, but that’s probably not the best way.