ElementTree를 사용하여 XML 파일을 구문 분석하는 작은 함수를 작성했지만 다음과 같은 오류가 발생합니다. "xml.etree.ElementTree.ParseError : 형식이 올바르지 않습니다 (잘못된 토큰) : 줄 1, 열 0 ". 아래의 코드를 발견하시기 바랍니다ElementTree를 사용하여 xml 구문 분석
tree = ElementTree.parse(urllib2.urlopen('http://api.ean.com/ean-services/rs/hotel/v3/list?type=xml&apiKey=czztdaxrhfbusyp685ut6g6v&cid=8123&locale=en_US&city=Dallas%20&stateProvinceCode=TX&countryCode=US&minorRev=12'))
rootElem = tree.getroot()
hotel_list = rootElem.findall("HotelList")
XML 파일의 첫 번째 줄을 보는 것이 유용 할 수 있습니다. 가능한 http://stackoverflow.com/questions/6260144/expaterror-not-well-formed-invalid-token의 중복 – ClassicThunder