python openpyxl写入多行_openpyxl在Ex中写入多行
我正在尝试将多行写入Excel。”“容器”的索引/长度为10。虽然我只运行了一行脚本。在有人能帮我吗?在# define first empty rowstart_row = sheet.max_row + 1#write to excelfor container in containers:#Company namecompany_container = container.div.h2com
我正在尝试将多行写入Excel。”“容器”的索引/长度为10。虽然我只运行了一行脚本。在
有人能帮我吗?在# 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")
更多推荐
所有评论(0)