把数据写到excel表里

2020-11-18  本文已影响0人  绛珠仙靖

list= Scrape_news.url_link('http://www.qdaily.com',"span", {"class":"line"})

Scrape_news.url_link('http://www.qdaily.com',"a")

wb = Workbook ()

ws1 = wb.active

for rowin list:

ws1.append ( row)

wb.save ('aaaaa.xlsx' )

报错:Value must be a list, tuple, range or generator, or a dict. Supplied value is <class 'str'>

解决: ws1.append ( row)  写成 ws1.append ( [row])

上一篇下一篇

猜你喜欢

热点阅读