Dec-05-2023, 08:53 AM
from this website
https://oddspedia.com/football/italy/serie-a
for example from this event:
https://oddspedia.com/football/juventus-napoli-65193
inspecting page from browser this is the part that i need:
https://oddspedia.com/football/italy/serie-a
for example from this event:
https://oddspedia.com/football/juventus-napoli-65193
import requests from bs4 import BeautifulSoup url = "https://oddspedia.com/football/juventus-napoli-65193" # Effettua una richiesta GET alla pagina web response = requests.get(url) # Controlla se la richiesta è andata a buon fine if response.status_code == 200: # Parsing dell'HTML della pagina con BeautifulSoup soup = BeautifulSoup(response.text, 'html.parser') # Trova tutti gli elementi div con la classe "event-stats-scoring-minutes__list__item" items = soup.find_all('div', class_='event-stats-scoring-minutes__list__item') for item in items: label = item.find('span', class_='event-stats-scoring-minutes__list__label').get_text(strip=True) print(f"{label}: {item.find('div', class_='event-stats-progress-bar-vertical__lines__full')['style']}") else: print(f"Errore nella richiesta. Codice di stato: {response.status_code}")is it possible to scrape the values of the chart?
inspecting page from browser this is the part that i need:
Quote:<div class="event-stats-scoring-minutes__list"><div class="event-stats-scoring-minutes__list__item"><div class="event-stats-scoring-minutes-progressbar-wrapper"><div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 82%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 18%; background-color: rgb(0, 177, 255);"></div></div></div> <div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 96%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 4%; background-color: rgb(26, 49, 80);"></div></div></div></div> <span class="event-stats-scoring-minutes__list__label">
0-15'
</span></div><div class="event-stats-scoring-minutes__list__item"><div class="event-stats-scoring-minutes-progressbar-wrapper"><div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 77%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 23%; background-color: rgb(0, 177, 255);"></div></div></div> <div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 81%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 19%; background-color: rgb(26, 49, 80);"></div></div></div></div> <span class="event-stats-scoring-minutes__list__label">
16-30'
</span></div><div class="event-stats-scoring-minutes__list__item"><div class="event-stats-scoring-minutes-progressbar-wrapper"><div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 95%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 5%; background-color: rgb(0, 177, 255);"></div></div></div> <div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 77%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 23%; background-color: rgb(26, 49, 80);"></div></div></div></div> <span class="event-stats-scoring-minutes__list__label">
31-45'
</span></div><div class="event-stats-scoring-minutes__list__item"><div class="event-stats-scoring-minutes-progressbar-wrapper"><div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 86%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 14%; background-color: rgb(0, 177, 255);"></div></div></div> <div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 88%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 12%; background-color: rgb(26, 49, 80);"></div></div></div></div> <span class="event-stats-scoring-minutes__list__label">
46-60'
</span></div><div class="event-stats-scoring-minutes__list__item"><div class="event-stats-scoring-minutes-progressbar-wrapper"><div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 82%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 18%; background-color: rgb(0, 177, 255);"></div></div></div> <div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 88%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 12%; background-color: rgb(26, 49, 80);"></div></div></div></div> <span class="event-stats-scoring-minutes__list__label">
61-75'
</span></div><div class="event-stats-scoring-minutes__list__item"><div class="event-stats-scoring-minutes-progressbar-wrapper"><div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 77%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 23%; background-color: rgb(0, 177, 255);"></div></div></div> <div class="event-stats-progress-bar-vertical"><div class="event-stats-progress-bar-vertical__lines"><div class="event-stats-progress-bar-vertical__lines__empty" style="height: 69%; background-color: rgb(225, 231, 237);"></div> <div class="event-stats-progress-bar-vertical__lines__full" style="height: 31%; background-color: rgb(26, 49, 80);"></div></div></div></div> <span class="event-stats-scoring-minutes__list__label">
76-90'
</span></div></div>
Error:Errore nella richiesta. Codice di stato: 520