I am trying to write multiple rows to Excel. "Containers" has an index/len of 10. Although I loop through it, I only get one row when I run the script.
Can anyone help me with this?
# define first empty row
start_row = sheet.max_row + 1
#write to excel
for container in containers:
#Company name
company_container = container.div.h2
company = company_container.text.strip()
#City
city = container.div.a["title"]
#URL
url = container.div.div.a["href"]
#Title
title_container = container.findAll("div", {"class":"info"})
title = title_container[0].img["alt"]
#Description
description = title_container[0].p.text
#Programming language
hardskill = "Java"
#Vervolgactie (Teamleader)
vervolgactie = "Nieuw"
companyinfo = [company, city, url, title, description, hardskill, vervolgactie]
for i in range(0,len(companyinfo)):
e=sheet.cell(row=start_row,column=1+i)
e.value=companyinfo[i]
wb.save("vacatures.xlsx")