我有这个HTML:
<tr class="even expanded first>
<td class="score-time status">
<a href="/matches/2012/08/02/europe/uefa-cup/">
16 : 00
</a>
</td>
</tr>
Run Code Online (Sandbox Code Playgroud)
我想在没有额外空格的情况下提取(16:00)字符串.这可能吗?
我知道这是一个愚蠢的问题,但我知道如何做到这一点.从这个链接 ,请求的链接可以返回NSURLconnection的json数据?我希望有人检查这个链接并告诉我这是否可能,因为我是这个东西的新手.
编辑:
我尝试过NSJSONSerialization
- (void)viewDidLoad
{
NSURLRequest *req = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.goalzz.com/main.aspx?region=-1&area=6&update=true"]];
connectionData = [[NSURLConnection alloc]initWithRequest:req delegate:self];
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response {
Data = [[NSMutableData alloc] init];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data {
[Data appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection {
NSError *jsonParsingError = nil;
id object = [NSJSONSerialization JSONObjectWithData:Data options:0 error:&jsonParsingError];
if (jsonParsingError) {
NSLog(@"JSON ERROR: %@", [jsonParsingError localizedDescription]); …Run Code Online (Sandbox Code Playgroud)