from lxml import etree import re root etree fromstring stroka re searc

1
2
3
4
5
from lxml import etree
import re
root = etree.fromstring(stroka)
m=re.search('<Placemark>\s+<name>\w+</name>\s+\W\w+\W\s+',stroka)
print m.group(0)