python爬取网页数据,写入excel表格报错

AttributeError: 'OpenpyxlWriter' object has no attribute 'save'该如何解决?

提供点示例代码给我看看,之前有回答过相似的问题,使用

  • OpenpyxlWriter对象的save()方法,但该对象并没有该方法
 for item in data:
        albumName = item['albumName']
        quantity = item['quantity']
        platformName = item['platformName']
        circulateQuantity = item['circulateQuantity']
        totalCirculateCapcital = item['totalCirculateCapcital']
        consignmentFloorPrice = item['consignmentFloorPrice']
        fluctuation = item['fluctuation']
        minAveragePrice = item['minAveragePrice']
        dic = {
            '名称': albumName,
            '平台名称': platformName,
            '发行量': quantity,
            '流通量': circulateQuantity,
            '市值': totalCirculateCapcital,
            '地板价': consignmentFloorPrice,
            '均价': minAveragePrice,
            '波动': fluctuation,
        }
        print(dic)
        resL.append(dic)

    df = pd.DataFrame(resL)
    writer = pd.ExcelWriter(f'元数网全部3.1.xlsx')
    df.to_excel(writer, 'Sheet1')
    df.to_excel(writer, index=False) #, encoding='utf-8'
    writer.save('元数网全部3.0.xlsx')


Traceback (most recent call last):
  File "C:\Users\yaoyao\Desktop\元数网代码4.12日.py", line 53, in <module>
    main()
  File "C:\Users\yaoyao\Desktop\元数网代码4.12日.py", line 38, in main
    writer = pd.ExcelWriter(f'元数网全部3.1.xlsx')
  File "D:\python\lib\site-packages\pandas\io\excel\_openpyxl.py", line 88, in __init__
    self.book.remove(self.book.worksheets[0])
AttributeError: 'Workbook' object has no attribute 'remove'

```今天又出现了新的错误...