I am trying to use BeautifulSoup and requests to scrape the table here into a data frame. I used to be able to do this using this:
url = "https://www.vegasinsider.com/college-basketball/odds/las-vegas/money/"
soup = BeautifulSoup(requests.get(url).content, "html.parser")
for br in soup.select("br"):
br.replace_with("\n")
base = pd.read_html(str(soup.select_one(".frodds-data-tbl")))[0]
Sadly, the website's layout completely changed overnight. I am now getting this value error:
ValueError: No tables found
This is because I was previously looking for a table. Now the data is stored in a series of nested divs. I have been able to make some headway with this code here:
url = "https://www.vegasinsider.com/college-basketball/odds/las-vegas/"
page = requests.get(url).text
soup = BeautifulSoup(page, "html.parser")
divList = soup.findAll('div', attrs={"class" : "bc-odds-table bc-table"})
print(divList)
I have also been able to get thought and find where I am looking to pull data from here:
I was also able to get something by doing this:
data = [[x.text for x in y.findAll('div')] for y in divList]
df = pd.DataFrame(data)
print(df)
[1 rows x 5282 columns]
How would I be able to loop through these divs and return the data in a pandas dataframe?
When using div.text, it returns one long string of the data that I want. I could split this string up into many pieces and glue it into a df where I want it to go. But that seems like a hack job at best.

pandas.read_html()only read tables and what you inspected is not a table it is adiv. So you have to scrape it "manually" or find an api.