<?xml version="1.0" encoding="UTF-8"?><export xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://zakupki.gov.ru/oos/export/1" xmlns:oos="http://zakupki.gov.ru/oos/types/1"> <contract schemeVersion="1.0"> <oos:id>13700110</oos:id> <oos:regNum>0365200021414000003</oos:regNum> <oos:number>1</oos:number> <oos:publishDate>2014-01-13T17:18:41Z</oos:publishDate> <oos:signDate>2014-01-09</oos:signDate> <oos:versionNumber>0</oos:versionNumber> <oos:foundation> <oos:oosOrder> <oos:notificationNumber>0365200021413000103</oos:notificationNumber> <oos:lotNumber>1</oos:lotNumber> <oos:placing>9</oos:placing> </oos:oosOrder> </oos:foundation> <oos:customer> <oos:regNum>03652000214</oos:regNum> <oos:fullName>областное государственное бюджетное учреждение "Служба хозяйственного обеспечения"</oos:fullName> <oos:inn>7017297271</oos:inn> <oos:kpp>701701001</oos:kpp> </oos:customer> <oos:protocolDate>2013-12-25</oos:protocolDate> <oos:documentBase>Протокол рассмотрения и оценки котировочных заявок №0365200021413000103-П от 25.12.2013; Протокол рассмотрения и оценки котировочных заявок №0365200021413000103-П от 25.12.2013</oos:documentBase> <oos:price>230400</oos:price> </contract> </export>
Вот код, который я пишу, пытаясь спарсить файл:
from xml.etree import ElementTree fname='contract.xml' dom=ElementTree.parse(fname) name = dom.findall('contract/oos:id') print (name)
Выдаёт ошибку:
Traceback (most recent call last):
File “C:\Program Files (x86)\Python\lib\xml\etree\ElementPath.py”, line 257, in iterfind
selector = _cache
KeyError: ('contract/oos:id', None)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “C:\Program Files (x86)\Python\lib\xml\etree\ElementPath.py”, line 80, in xpath_tokenizer
raise KeyError
KeyError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File “CUsers/Н/Desktop/parser1.py”, line 4, in <module>
name = dom.findall('contract/oos:id')
File “C:\Program Files (x86)\Python\lib\xml\etree\ElementTree.py”, line 697, in findall
return self._root.findall(path, namespaces)
File “C:\Program Files (x86)\Python\lib\xml\etree\ElementPath.py”, line 298, in findall
return list(iterfind(elem, path, namespaces))
File “C:\Program Files (x86)\Python\lib\xml\etree\ElementPath.py”, line 274, in iterfind
token = next()
File “C:\Program Files (x86)\Python\lib\xml\etree\ElementPath.py”, line 83, in xpath_tokenizer
raise SyntaxError(“prefix %r not found in prefix map” % prefix)
File “<string>”, line None
SyntaxError: prefix ‘oos’ not found in prefix map
Убирала “oos:”, тогда программа просто ничего не находит
Я упёрлась в стенку, помогите пожалуйста

Users/Н/Desktop/parser1.py”, line 4, in <module>