Thanks but my main goal is to obtain values of the charts for that minutes.. ['0-15', '0-30', '1-45', '6-60', '1-75', '0-90']
[Image: Immagine.png]
for item in items:
label = item.find('span', class_='event-stats-scoring-minutes__list__label').get_text(strip=True)
team1_percentage = int(re.search(r'height:\s*(\d+)%', item.find('div', class_='event-stats-progress-bar-vertical__lines__full')['style']).group(1))
# Esempio: Stampa i risultati per la squadra 1
print(f"{label} - Team 1: {team1_percentage}%")
# Se hai bisogno anche dei valori per la squadra 2, puoi replicare il processo cambiando la classe
# Esempio: Stampa i risultati per la squadra 2
team2_percentage = int(re.search(r'height:\s*(\d+)%', item.find('div', class_='event-stats-progress-bar-vertical__lines__full')['style']).group(1))
print(f"{label} - Team 2: {team2_percentage}%")
maybe i solved. but i am not sure if are the real values of the chart.. there are 2 values for each column in the source.
[Image: Immagine.png]
import requests from bs4 import BeautifulSoup import re url = "https://oddspedia.com/football/juventus-napoli-65193" headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36'} response = requests.get(url, headers=headers) soup = BeautifulSoup(response.content, 'lxml') # 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)
team1_percentage = int(re.search(r'height:\s*(\d+)%', item.find('div', class_='event-stats-progress-bar-vertical__lines__full')['style']).group(1))
# Esempio: Stampa i risultati per la squadra 1
print(f"{label} - Team 1: {team1_percentage}%")
# Se hai bisogno anche dei valori per la squadra 2, puoi replicare il processo cambiando la classe
# Esempio: Stampa i risultati per la squadra 2
team2_percentage = int(re.search(r'height:\s*(\d+)%', item.find('div', class_='event-stats-progress-bar-vertical__lines__full')['style']).group(1))
print(f"{label} - Team 2: {team2_percentage}%")
maybe i solved. but i am not sure if are the real values of the chart.. there are 2 values for each column in the source.
Output:0-15' - Team 1: 18%
0-15' - Team 2: 18%
16-30' - Team 1: 23%
16-30' - Team 2: 23%
31-45' - Team 1: 5%
31-45' - Team 2: 5%
46-60' - Team 1: 14%
46-60' - Team 2: 14%
61-75' - Team 1: 18%
61-75' - Team 2: 18%
76-90' - Team 1: 23%
76-90' - Team 2: 23%