I have a file where with a regular expression I get 3 data that can be repeated up to 30 times
matches = tools.findall(pattern, html, re.MULTILINE)
for match in matches:
pattern = 'umber\":(.*?),\"g'
dato1 = tools.findall(pattern, match, re.MULTILINE)[0]
pattern = '\],\"name\"\:\"(.*?)\",\"ov'
dato2 = tools.findall(pattern, match, re.MULTILINE)[0]
pattern = '\"overview\"\:\"(.*?)\",\"id'
dato3 = tools.findall(pattern, match, re.MULTILINE)[0]
my intension is with these data generate an xml in the following way:
<root>
<item>
<nombre>dato1</nombre>
<direccion>dato2</direccion>
<telefono>dato3</telefono>
</item>
<item>
<nombre>dato1</nombre>
<direccion>dato2</direccion>
<telefono>dato3</telefono>
</item>
<item>
<nombre>dato1</nombre>
<direccion>dato2</direccion>
<telefono>dato3</telefono>
</item>
<root>
the items I want to repeat as many data are collected from the for loop