0

I am working on gather sports statistics for a personal hobby project. I found this site with all the info I need:file:///Users/JohnJNichols4/Desktop/view-source%20cluster.leaguestat.com%20download.php%20client_code=ahl&file_path=daily-report%20daily-report.html

Am I able to parse this site with xpath? I only have experience (little experience) with cocoa and xcode, so I am writing this is objective c with a wrapper called hpple. My problem arises when I need to pull info from the tables. I have no idea how to go about this. The xpath expressions that I enter are all wrong. Can anyone show me how one might parse the standings in the first table? The function I am using is:

NSArray *elements  = [xpathParser search:@"xpath stuff goes here"];

Thanks a lot!

EDIT URL

Sorry guys, I put up the local URL by mistake. Here is the right one: http://cluster.leaguestat.com/download.php?client_code=ahl&file_path=daily-report/daily-report.html

3
  • The site you referenced was a local file URL. You may want to edit your post and put in the correct URL. Commented Oct 25, 2010 at 19:35
  • If you show us what the input XML looks like, and which elements or attributes you want to select, that will help people help you determine what the XPath expressions need to be. Commented Oct 25, 2010 at 19:36
  • Just edited the URL above. Sorry about that. Commented Oct 25, 2010 at 19:43

1 Answer 1

1

If you want to treat it as XML, you can, but it'll have to be properly formed, which isn't always the case with HTML. I'd recommend using the TouchXML library, it has great xpath support and a fair amount of documentation and examples.

http://foobarpig.com/iphone/touchxml-installation-guide.html

Sign up to request clarification or add additional context in comments.

1 Comment

The reason I can't treat it as html is because I want my program to automatically pull the updated stats every day. Can that happen if I convert the page to html?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.