You don't have
Test with your file.
encoding='utf-8'
when you read the file as i show.Test with your file.
with open('input.gpx') as f: print(f.read())
Output:<?xml version="1.0" encoding="UTF-8"?>
<desc>Départ entre 7 et 8h</desc>
</gpx>
Fix:with open('input.gpx', encoding='utf-8') as f: print(f.read())
Output:<?xml version="1.0" encoding="UTF-8"?>
<desc>Départ entre 7 et 8h</desc>
</gpx>
As it's a .xml file,BS parser test.from bs4 import BeautifulSoup soup = BeautifulSoup(open('input.gpx', encoding='utf-8'), 'xml') print(soup.find('desc').text)
Output:Départ entre 7 et 8h