sofifa-web-scraper icon indicating copy to clipboard operation
sofifa-web-scraper copied to clipboard

Nationality

Open broshv opened this issue 1 year ago • 1 comments

Hey Prashant!

I'm not great at JavaScript, only Python, so I downloaded the output file instead of the code since I don't really know how to operate it and make adjustments. Not sure if this is only a problem for the output file or the program in general, but some players don't have their nationalities under country_id, country_name, and etc. For example, Harry Kane has his nationality saved in the file, but Vinicius Junior doesn't.

Could you look into this? Thanks.

broshv avatar Aug 02 '24 14:08 broshv

I just checked some more on sofifa. Looks like the code is taking the ID and Name of the National Team, and not the Nationality. Some countries like Brazil don't have National Teams but have Nationalities. I checked and the Nationality ID and Name can be found on the player page, under the player name.

The country_id for Norway that the scraper is using is '1352'. That's Norway's National Team ID (Team as in Real Madrid, Man City, etc.). It should instead be taking the Nationality ID, which for Norway is '36'. Screenshot 2024-08-02 181215 Screenshot 2024-08-02 181334 Screenshot 2024-08-02 181324 Screenshot 2024-08-02 181317

broshv avatar Aug 02 '24 15:08 broshv