'Need help using pandas to covert a url into a dataframe for college basketball data
I am trying to get barttorvik.com data into a dataframe. I can scrape with the following code, but I get an error when trying to export the dataframe into excel.
I am assuming the error has to do with the header row on the site's table. I am unsure how to modify the imported data to make it exportable. Any help would be appreciated and thank you in advance.
import pandas as pd
url = 'https://www.barttorvik.com/#'
df = pd.read_html(url)
df.to_excel('/outputdestination', index=False)
This is the error I get after running the code
AttributeError: 'list' object has no attribute 'to_excel'
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
