0

I am using tfhpple on IOS to fetch some data feom web. I have this bit of code:

<tr class="odd">
<td class="datet t1360260000-6-1-0-0">
07/02
<br>
19:00
</td>
<td>
....................
</td>
</tr>

The portion I am trying to fetch is 07/02 and 19:00 (concatenated, if possible). But I have problems not only with unclosed <br> tag but also with first value.

Vitaly S.
  • 2,389
  • 26
  • 40

2 Answers2

0

You can try replacing
tag from string replace method, then try to extract values.

[strHTML stringByReplacingOccurrencesOfString:@"<br>" withString:@""];
iphonic
  • 12,615
  • 7
  • 60
  • 107
0

Hmm... weird.. This is how I accomplished your answer, but still dont get what I want:

NSURL *URL = [NSURL URLWithString:@"http://www.site.com"];
NSString *string= [NSString stringWithContentsOfURL:URL encoding:NSUTF8StringEncoding error:nil];
NSString *replacedBRFinal = [string stringByReplacingOccurrencesOfString:@"<br>" withString:@""];
NSData *data= [replacedBRFinal dataUsingEncoding:NSUTF8StringEncoding];
.......
TFHpple *parser = [TFHpple hppleWithHTMLData:data];
.......
// Query
NSString *query = @"//tr[@class='odd']/td[@class][1]";

And I am getting only "-". Same thing if I vew source, but in Firebug (Firefox extension) I can see the code from my question...