I'm trying to get the chart data stored in div data-moves= list of dictionaries from this bs4.element.Tag (data) and cant seem to figure out why it's not working.
The data I want is:
<div id="event-swing-container" data-moves='[{"name":"Change since opening","data":[["Magomed Ankalaev",-73],["Azamat Murzakanov",-56],....,["Marlon Moraes",1]],"visible":false}]' id="event-swing-container" style="height: 230px;"></div>
Here's my code so far:
from bs4 import BeautifulSoup
import requests
URL = 'https://www.bestfightodds.com/events/ufc-2414'
page = requests.get(URL)
esoup = BeautifulSoup(page.content, "html.parser")
data = esoup.find('div', id='event-swing-container')
json.loads()once you have the contents ofdata-moves.