I've got this code:
import pandas as pd
import requests
from bs4 import BeautifulSoup
res = requests.get("https://www.bankier.pl/gielda/notowania/akcje")
soup = BeautifulSoup(res.content,'lxml')
table = soup.find_all('table')[0]
df = pd.read_html(str(table))
writer = pd.ExcelWriter('test.xlsx',engine='xlsxwriter')
workbook = writer.book
df.to_excel(writer,sheet_name='quotations',startrow=0 , startcol=0)
after running it, the following error shows up:
AttributeError: 'list' object has no attribute 'to_excel'
Can anybody help me?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…