[GH-ISSUE #708] Fotmob Team Match Stats SSL Error #153

Closed
opened 2026-03-02 15:56:13 +03:00 by kerem · 1 comment
Owner

Originally created by @flynn-ryder44 on GitHub (Sep 17, 2024).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/708

Describe the bug
Having issues connecting to Fotmob read_team_match_stats(). Getting a Verification/Connection Error with SSL

I tried with cache turned on and off. Also tried running on a normal .py file as well as through Jupyter Notebook but got the same error. I also tried a few different stat types/leagues and received the same error.

Affected scrapers
This affects the following scrapers:

  • FotMob

Code example

import pandas as pd
import soccerdata as sd

# Establishing Connection to Fotmob
fotmob = sd.FotMob(
                        leagues='ESP-La Liga', 
                        seasons='2022/2023',
                        no_cache=True
                    )
					
TopStats = fotmob.read_team_match_stats(stat_type='Top stats', opponent_stats=True, team=None)

Error message

requests.exceptions.SSLError: HTTPSConnectionPool(host='www.fotmob.com',
                             port=443): Max retries exceeded with url: /api/allLeagues (Caused by
                             SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED]
                             certificate verify failed: unable to get local issuer certificate
                             (_ssl.c:1007)')))

Additional context
The above error message is part of a much larger one since it makes 5 attempts to connect each time I run the script.

Also, I've already attempted doing some searching for like errors in other packages and tried to add a system variable with the certifi package as described here, but that did not change the error message either.

(I'm working on a PC if that matters since it seems SSL is very different on PC vs Mac)

I hugely appreciate any help that anyone can provide!!

Contributor Action Plan

  • I can fix this issue and will submit a pull request.
  • I’m unsure how to fix this, but I'm willing to work on it with guidance.
  • I’m not able to fix this issue.
Originally created by @flynn-ryder44 on GitHub (Sep 17, 2024). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/708 **Describe the bug** Having issues connecting to Fotmob read_team_match_stats(). Getting a Verification/Connection Error with SSL I tried with cache turned on and off. Also tried running on a normal .py file as well as through Jupyter Notebook but got the same error. I also tried a few different stat types/leagues and received the same error. **Affected scrapers** This affects the following scrapers: - [x] FotMob **Code example** ```python import pandas as pd import soccerdata as sd # Establishing Connection to Fotmob fotmob = sd.FotMob( leagues='ESP-La Liga', seasons='2022/2023', no_cache=True ) TopStats = fotmob.read_team_match_stats(stat_type='Top stats', opponent_stats=True, team=None) ``` **Error message** ``` requests.exceptions.SSLError: HTTPSConnectionPool(host='www.fotmob.com', port=443): Max retries exceeded with url: /api/allLeagues (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)'))) ``` **Additional context** The above error message is part of a much larger one since it makes 5 attempts to connect each time I run the script. Also, I've already attempted doing some searching for like errors in other packages and tried to add a system variable with the certifi package as described [here](https://medium.com/@vkmauryavk/resolving-sslcertverificationerror-certificate-verify-failed-unable-to-get-local-issuer-515d7317454f), but that did not change the error message either. (I'm working on a PC if that matters since it seems SSL is very different on PC vs Mac) I hugely appreciate any help that anyone can provide!! **Contributor Action Plan** - [ ] I can fix this issue and will submit a pull request. - [x] I’m unsure how to fix this, but I'm willing to work on it with guidance. - [ ] I’m not able to fix this issue.
kerem 2026-03-02 15:56:13 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@flynn-ryder44 commented on GitHub (Sep 20, 2024):

Update: for anyone who has this problem on PC, I fixed it by doing the equivalent of "Install Certificates.command" in Terminal on a mac...

Script is here

A couple specific issues I had with it:

  • I had to create a folder named "SSL" in C:\Program Files\Common Files\ for the script to reference
  • Make sure when you run it that you're in command prompt as an administrator (I had an error which went away when I did this)

Not sure of the exact solution for Mac specifically, but I came across this when a similar problem had been solved on a mac on this StackOverflow post so hopefully this can help folks on Mac as well!

<!-- gh-comment-id:2363561505 --> @flynn-ryder44 commented on GitHub (Sep 20, 2024): Update: for anyone who has this problem on PC, I fixed it by doing the equivalent of "Install Certificates.command" in Terminal on a mac... Script is [here](https://gist.github.com/marschhuynh/31c9375fc34a3e20c2d3b9eb8131d8f3) A couple specific issues I had with it: - I had to create a folder named "SSL" in C:\Program Files\Common Files\ for the script to reference - Make sure when you run it that you're in command prompt as an administrator (I had an error which went away when I did this) Not sure of the exact solution for Mac specifically, but I came across this when a similar problem had been solved on a mac on [this StackOverflow post](https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate#comment104160264_58525755) so hopefully this can help folks on Mac as well!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/soccerdata#153
No description provided.