Created
January 17, 2018 18:25
-
-
Save slackorama/b31cd23112ffc1d00dce59fb296e5040 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import objectify | |
tree = objectify.parse('/home/seth/Downloads/slackorama-2018-01-17-pettit-1-9725148.tcx') | |
root = tree.getroot() | |
namespaces = {'ns': 'http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2', | |
'ns3': 'http://www.garmin.com/xmlschemas/ActivityExtension/v2'} | |
for tp in root.xpath('//ns:Trackpoint', namespaces=namespaces): | |
print(tp.Time); | |
print(tp.xpath('.//ns:Extensions/ns3:TPX/ns3:Watts', namespaces=namespaces)[0]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment