Search code examples
xmlxpathxpath-2.0

Xpath syntax to extract all player elements with sport = NBA


I'm attempting to extract all player data for players under the sport = NBA. How do I write the Xpath syntax to extract that data. The API feed I'm working with is located here:

https://www.fanduel.com/api/grindersplayerprices?date=2014-11-11

I'd also like to limit the results to the minimum Game: Start Time within the NBA node. So with sport = NBA there might be multiple start times. I don't care what the start time is, but I only want the minimum start time within the NBA node.


Solution

  • To get all NBA players your could do this

    //fixturelist[sport='NBA']/player
    

    Not sure about the other requirement. Please provide more detail.