How can I create outputs created in two for loops?
What I would like to have:
Name1
Adress1
Name2
Adress2
..
What I get:
Name1
Name2
Adress1
Adress2
I have already tried a lot and brought back to the initial situation.
The names and the adresses are parsed from a HTML document, and written with the for loops into a txt file. (in the first step to the console)
I thank you in advance!
with urllib.request.urlopen("file:///C:/Users/x/Desktop/test.html") as url:
soup = BeautifulSoup(url, "html.parser")
for name in soup.findAll("div", { "class" : "name m08_name" }):
print(name.get_text())
for adress in soup.findAll("div", { "class" : "adresse m08_adresse" }):
print(adress.get_text())