Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
oddspedia charts
#3
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]

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%
Reply


Messages In This Thread
oddspedia charts - by nicoali - Dec-05-2023, 08:53 AM
RE: oddspedia charts - by snippsat - Dec-05-2023, 01:32 PM
RE: oddspedia charts - by nicoali - Dec-05-2023, 04:44 PM
RE: oddspedia charts - by snippsat - Dec-05-2023, 06:20 PM
RE: oddspedia charts - by nicoali - Dec-05-2023, 08:08 PM
RE: oddspedia charts - by nicoali - Dec-07-2023, 04:47 PM
RE: oddspedia charts - by snippsat - Dec-07-2023, 06:51 PM
RE: oddspedia charts - by nicoali - Dec-07-2023, 08:01 PM
RE: oddspedia charts - by snippsat - Dec-08-2023, 03:09 PM
RE: oddspedia charts - by nicoali - Dec-08-2023, 06:09 PM
RE: oddspedia charts - by snippsat - Dec-08-2023, 09:25 PM
RE: oddspedia charts - by nicoali - Dec-09-2023, 02:59 PM
RE: oddspedia charts - by snippsat - Dec-09-2023, 11:36 PM
RE: oddspedia charts - by nicoali - Dec-10-2023, 10:00 AM
RE: oddspedia charts - by snippsat - Dec-10-2023, 11:27 AM
RE: oddspedia charts - by nicoali - Dec-10-2023, 11:40 AM
RE: oddspedia charts - by snippsat - Dec-10-2023, 04:38 PM
RE: oddspedia charts - by nicoali - Dec-11-2023, 08:26 AM
RE: oddspedia charts - by nicoali - Dec-11-2023, 04:44 PM
RE: oddspedia charts - by snippsat - Dec-11-2023, 10:57 PM
RE: oddspedia charts - by nicoali - Dec-15-2023, 10:06 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Configuration file through helm charts saisankalpj 0 1,862 Aug-23-2022, 01:32 PM
Last Post: saisankalpj
  Cannot Extract data through charts online AgileAVS 0 1,948 Feb-01-2020, 01:47 PM
Last Post: AgileAVS

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020