prashantghimire / sofifa-web-scraper

JavaScript scrapper for over 18k detailed players info and stats from EA FC 25 from SoFIFA.com.
33 stars 5 forks source link

Nationality #21

Closed broshv closed 4 weeks ago

broshv commented 3 months ago

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 commented 3 months ago

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