我正在尝试将多行写入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")

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐