Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting a xPath from XML document

Tags:

xpath

I am trying to get some values from an online XML document, but I cannot find the right xpath to navigate to those values. I want to import these values into a Google Spreadsheet document, which requires me to get the exact xpath.

The website is this one, and I am trying to get the information for "WillPay" information from MeetingInfo Venue=S1, Races RaceNo=1, Pools PoolInfo Pool=WIN, in OddsInfo.

For now, the value of "Number=1" should be 3350 (or something close to this, it changes quite often), and I would like to load all of these values onto the google spreadsheet document.

What I've tried is locating the xpath of all of it, and tried to my best attempt to get

"/AOSBS_XML/Meetings/MeetingInfo/Races/Pools/PoolInfo/OddsSet/OddsInfo/@WillPay"

but it doesn't work.

I've been stuck on this problem for months now and I've been avoiding it, but realised I can't anymore because it's hindering my work. Please help.

Thanks! -Brandon

like image 495
Brandon Chiu Avatar asked Aug 13 '26 15:08

Brandon Chiu


1 Answers

Try using this xpath expression:

//MeetingInfo[@Venue="S1"]/Races//RaceInfo[@RaceNo="1"]//Pools//PoolInfo[@Pool="WIN"]//OddsSet//OddsInfo[@Number="1"]/@WillPay
like image 173
Jack Fleeting Avatar answered Aug 17 '26 07:08

Jack Fleeting



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!