mxl1503 / arbitrage-betting-bot

MIT License
2 stars 0 forks source link

Error when a team is not found (Different Home and Away Odds Length) #1

Open benjamen opened 5 months ago

benjamen commented 5 months ago

Hey Mate, Love the code and would like to explain it for Betfair. I have found when one of the sites doesn't have the team odds then the length and index of the home and away odds table don't match there is an exception.

Traceback (most recent call last): File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\main.py", line 78, in main() File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\main.py", line 75, in main tabulate_data(team_dict) File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\main.py", line 44, in tabulate_data opp = round((1/home_odds[i] + 1/away_odds[i]) * 100, 3)


IndexError: list index out of range

This is link to this issue:

Running for Sportsbet
[24932:19388:0114/145142.559:ERROR:cert_verify_proc_builtin.cc(705)] CertVerifyProcBuiltin for cdn.outbound.io failed:
----- Certificate i=0 (CN=ssl765948.cloudflaressl.com) -----
ERROR: Time is after notAfter

[7196:10228:0114/145142.561:ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -200
mxl1503 commented 5 months ago

Hey Benjamen, thanks for letting me know about this and I'm glad that this can be of use to you! I will add functionality for Betfair (+ other bookies) when I revisit this project in a little while. Regarding issues with index errors (should've used try catch blocks oops), it's usually being caused by websites displaying live odds which sometimes messes up the data tabulation. Are you running into this issue in the above scenario, or is it something completely separate?

WIth the second error message, looking like an SSL verification issue. That might be a byproduct of something wrong with scraping, I'm really not sure. Let me do some testing and see if I can recreate this behaviour. Thanks for giving me a headsup!

benjamen commented 5 months ago

Correct about the Live Odds, i think as it's the NBA games are on right now. Awesome. Let me know if i can help with anything

mxl1503 commented 5 months ago

If it's because of the live odds, I think I have a fix figured out. Shouldn't take me too long, thanks for the headsup.

benjamen commented 5 months ago

No worries, Just to clarify I think SPORTSBET is the SSL issue causing the different the Home and Away Odds Lengths (so i have commented out on my copy) and then for POINTSBET i think is a live odd issue - see below (as this was not an issue before the game) :

Running for Pointsbet Traceback (most recent call last): File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\main.py", line 81, in main() File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\main.py", line 74, in main redirector_function(driver, bookie_info, team_dict) File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\main.py", line 25, in redirector_function find_pointsbet_odds(driver, team_dict, bookie_url) File "C:\Users\benwa\Documents\arbitrage-betting-bot\src\find_odds.py", line 90, in find_pointsbet_odds if team_dict[team_name][0] < betting_odds:


KeyError: 'Orlando Magic'
mxl1503 commented 5 months ago

Yep the tool should work fine before any games start (though betfair seems to have issues on occasion since sometimes they 'feature' games?). I know Sportsbet also offers live odds, so I'll look into a fix for both.

benjamen commented 5 months ago

That's great thank you.