scrapeOP icon indicating copy to clipboard operation
scrapeOP copied to clipboard

Scraping soccer odds fails

Open dauhonk opened this issue 3 years ago • 4 comments

Since 2022-01-21 the scraping of soccer odds from oddsportal does return only empty values. It seems like some changes were made to the oddsprotal html, so the scaping needs to be corrected.

Data will be saved in the following directory: /home/user/scrapeOP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[]
Function crashed, probable reason : no games scraped (empty season)
Traceback (most recent call last):
  File "FinalScraper.py", line 17, in <module>
    scrape_oddsportal_next_games(sport = 'soccer', country = 'france', league = 'ligue-1', season = '2021')
  File "/home/user/scrapeOP/functions.py", line 1386, in scrape_oddsportal_next_games
    df = create_clean_table_three_ways(df)
  File "/home/user/scrapeOP/create_clean_table.py", line 70, in create_clean_table_three_ways
    nbooks = df['Bookmaker'].nunique()
TypeError: 'int' object is not subscriptable

dauhonk avatar Jan 27 '22 11:01 dauhonk

I'm having the same issue. Any solution?

schick17 avatar Apr 17 '22 13:04 schick17

what worked for me was to replace the two lines in the "create_clean_table.py" that say...

for book in df['Bookmaker'].unique():

with...

for book in range(df['Bookmaker'].unique()):

schick17 avatar Apr 17 '22 14:04 schick17

Unfortunately that didn't work for me. I currently use my own (rather dirty) script to scrape the Bundesliga average odds

dauhonk avatar Apr 20 '22 11:04 dauhonk

Some problem here like dauhonk. Any solution?

manuelpicaro avatar Sep 14 '22 10:09 manuelpicaro

Hi, A new version was released today. The package is now adapted to the latest version of pandas, and corrects a few bugs related to cookies.

Hoping it solves your problem. Feel free to open a new issue if the new version still contains your bug.

Seb943 avatar Oct 23 '22 13:10 Seb943