DouBan.py 文件源码

python
阅读 37 收藏 0 点赞 0 评论 0

项目:Python-web-scraping 作者: LUCY78765580 项目源码 文件源码
def save_detail(self):
        book=xlwt.Workbook()
        sheet=book.add_sheet('sheet1',cell_overwrite_ok=True)
        heads=[u'??',u'??',u'??',u'????',u'??']
        ii=0
        for head in heads:
            sheet.write(0,ii,head)
            ii+=1

        container=self.get_detail()
        f=open(r'F:\Desktop\DouBan2.txt','w')
        i=1
        for list in container:
            f.writelines(list[5].encode('utf-8'))
            list.remove(list[5])
            j=0
            for data in list:
                sheet.write(i,j,data)
                j+=1
            i+=1
        f.close()
        print u'\n\n',u'??txt???'
        book.save('DouBan2.xls')
        print u'\n\n',u'??Excel??!'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号