please i need some help with Python. i have the folowwing result XML.
bloc_elements = soup.find_all('bloc')
RESULT =>
print(bloc_elements)
<Bloc>
<a>data_a</a>
<b>data_b</b>
<c>data_c</c>
<d>data_d</d>
</Bloc>
am trying to get this result :
List into CSV file :
a b c d
data_a data_b data_c data_d
this is what i have done:
elements_list = []
for element in bloc_elements:
elements_list.append(element.get_text())
print(elements_list)
am getting infortunatly this result:
data_a
data_b
data_c
data_d
Problems:
- I lost the tag (label of the line )
- the results are in vertical not horizontally
thank you so much for your help