[GH-ISSUE #126] [WhoScored] Date format problem #27

Closed
opened 2026-03-02 15:55:08 +03:00 by kerem · 8 comments
Owner

Originally created by @CBatatinha on GitHub (Dec 19, 2022).
Original GitHub issue: https://github.com/probberechts/soccerdata/issues/126

Hello,

I'm trying to pull the schedule from any league, but it keeps getting an error in the date format. Even when I input the match ID, keeps with problem to read the data because of the date format. How can I solve it?
ValueError:
time data 'Jumatatu, Des 26 2022 12:30' does not match format '%A, %b %d %Y %H:%M'

Originally created by @CBatatinha on GitHub (Dec 19, 2022). Original GitHub issue: https://github.com/probberechts/soccerdata/issues/126 Hello, I'm trying to pull the schedule from any league, but it keeps getting an error in the date format. Even when I input the match ID, keeps with problem to read the data because of the date format. How can I solve it? ValueError: time data 'Jumatatu, Des 26 2022 12:30' does not match format '%A, %b %d %Y %H:%M'
kerem 2026-03-02 15:55:08 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@probberechts commented on GitHub (Dec 19, 2022):

"Jumatatu" is apparently Swahili for "Monday". Swahili isn't even a supported language on WhoScored, so it is probably a bug in the website (which will resolve itself automatically) or a plugin in your browser which translates the dates automatically.

Which league / season are you trying to scrape?

<!-- gh-comment-id:1358158284 --> @probberechts commented on GitHub (Dec 19, 2022): "Jumatatu" is apparently Swahili for "Monday". Swahili isn't even a supported language on WhoScored, so it is probably a bug in the website (which will resolve itself automatically) or a plugin in your browser which translates the dates automatically. Which league / season are you trying to scrape?
Author
Owner

@CBatatinha commented on GitHub (Dec 19, 2022):

Premier League 2022

<!-- gh-comment-id:1358183564 --> @CBatatinha commented on GitHub (Dec 19, 2022): Premier League 2022
Author
Owner

@LuccaStochiero commented on GitHub (Feb 13, 2023):

Hello,

I've got the same problem as well. Trying to pull any match from any league, the page automatically translate to swahili and the data format doesn't match. I even turned on my VPN to see if the problem is here in Brazil but nothing really change

<!-- gh-comment-id:1428362813 --> @LuccaStochiero commented on GitHub (Feb 13, 2023): Hello, I've got the same problem as well. Trying to pull any match from any league, the page automatically translate to swahili and the data format doesn't match. I even turned on my VPN to see if the problem is here in Brazil but nothing really change
Author
Owner

@probberechts commented on GitHub (Feb 13, 2023):

I have no issues on the main domain, but experience the same problem on the 1xbet subdomain. For example on https://1xbet.whoscored.com/Regions/252/Tournaments/2/England-Premier-League. It seems that WhoScored uses Swahili as the default locale, but I haven't managed to figure out how to force WhoScored to set the English locale.

One workaround I see is to create a fallback function that attempts to parse dates as Swahilian if parsing as an English date fails. One thing to keep in mind here is that most people will not have the Swahili ("sw_KE") locale on their system, so I think it is best to just create a dict with days of the week and months to create the mapping. If someone would like to implement this, please go ahead.

<!-- gh-comment-id:1428707187 --> @probberechts commented on GitHub (Feb 13, 2023): I have no issues on the main domain, but experience the same problem on the 1xbet subdomain. For example on https://1xbet.whoscored.com/Regions/252/Tournaments/2/England-Premier-League. It seems that WhoScored uses Swahili as the default locale, but I haven't managed to figure out how to force WhoScored to set the English locale. One workaround I see is to create a fallback function that attempts to parse dates as Swahilian if parsing as an English date fails. One thing to keep in mind here is that most people will not have the Swahili ("sw_KE") locale on their system, so I think it is best to just create a dict with days of the week and months to create the mapping. If someone would like to implement this, please go ahead.
Author
Owner

@LuccaStochiero commented on GitHub (Feb 14, 2023):

Sorry for bother you again but i'm really a newbie in Python, more accustomed to R, do u know any place i can find a tutorial to make that dict?

<!-- gh-comment-id:1429023538 --> @LuccaStochiero commented on GitHub (Feb 14, 2023): Sorry for bother you again but i'm really a newbie in Python, more accustomed to R, do u know any place i can find a tutorial to make that dict?
Author
Owner

@probberechts commented on GitHub (Feb 14, 2023):

I'll see if I can implement this during the weekend. Currently not sure how to do it best either. I do not have experience with parsing non-English dates.

<!-- gh-comment-id:1429285552 --> @probberechts commented on GitHub (Feb 14, 2023): I'll see if I can implement this during the weekend. Currently not sure how to do it best either. I do not have experience with parsing non-English dates.
Author
Owner

@guilherme-95 commented on GitHub (Mar 1, 2023):

One possible workaround is routing traffic through a country in which 1xbet is not allowed to operate, as that will keep you within the main domain

<!-- gh-comment-id:1450647280 --> @guilherme-95 commented on GitHub (Mar 1, 2023): One possible workaround is routing traffic through a country in which 1xbet is not allowed to operate, as that will keep you within the main domain
Author
Owner

@probberechts commented on GitHub (Mar 1, 2023):

One possible workaround is routing traffic through a country in which 1xbet is not allowed to operate, as that will keep you within the main domain

Ah, interesting. Such as Belgium apparently 😃 I can browse directly to 1xbet.whoscored.com, but did not know that it gets redirected in other countries.

Anyway, I think the fix that I implemented in github.com/probberechts/soccerdata@a3bf31b977 is more straightforward. I only re-opened this issue because it looks like I made a small mistake (see https://github.com/ML-KULeuven/socceraction/issues/474).

<!-- gh-comment-id:1450803983 --> @probberechts commented on GitHub (Mar 1, 2023): > One possible workaround is routing traffic through a country in which 1xbet is not allowed to operate, as that will keep you within the main domain Ah, interesting. Such as Belgium apparently 😃 I can browse directly to 1xbet.whoscored.com, but did not know that it gets redirected in other countries. Anyway, I think the fix that I implemented in https://github.com/probberechts/soccerdata/commit/a3bf31b97790203cb296b2a8ef5120dd103239cf is more straightforward. I only re-opened this issue because it looks like I made a small mistake (see https://github.com/ML-KULeuven/socceraction/issues/474).
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#27
No description provided.