As a football fan, in the year-end inventory, how can not be without football. If you are a fan of European football, then you must know that 2019 is Liverpool’s year, not to mention that the Reds’ first Premier League title is already in sight. Fighting!

Data acquisition

Let’s take a look at how to get the data we need, we choose here is a foreign statistical website, you can view the scores and rankings of football clubs over the years

https://footballdatabase.com/ranking/world/1

Get club information

First of all, we need to get the information related to the club. Here, we select the top 200 clubs and use BeautifulSoup to parse the webpage

    for name in name_list:

        rank_list = []

        try:

            rank_point = name.find_all('td', attrs={'class''rank'})

            rank = rank_point[0].text

            point = rank_point[1].text

            club_info = name.find('td', attrs={'class''club text-left'}).find_all('a')

            club_url = club_info[0] ['href']

            club_name = club_info[0].find('div', attrs={'class''limittext'}).text

            club_country_url = club_info[1] ['href']

            club_country_name = club_info[1].text

            rank_list.append([rank, club_name, club_country_name, club_url, club_country_url, point])

            list_rank.append(rank_list)

            save_club_name(rank_list)



        except:

            pass

Copy the code

Once you have the information for each club, you can walk through the list to get the club’s score and ranking data over the years

Obtain club history data

Club history data is also stored in Javascript variables on the web page. How to obtain this data is also described in previous articles, so I won’t go into details here

his_rank_list = []

    for data in data_list:

        print(data)

        url = data[0] [3]

        his_res = requests.get(base_url + url)

        his_content = BeautifulSoup(his_res.text, "html.parser")

        js = his_content.find_all('script') [1].string

        src_text = js2xml.parse(js)

        src_tree = js2xml.pretty_print(src_text)

        data_tree = BeautifulSoup(src_tree, 'html.parser')

        array_list = data_tree.find_all('array')

        club_name = data[0] [1]

        for array in array_list[2:2 -] :

            his_rank_list = []

            array_date = array.find('string').text

            date = array_date

            try:

                month = month_map[array_date.split(' ') [0]]

                year = array_date.split(' ') [1]

                date = str(year) + The '-' + str(month)

            except:

                pass

            array_data = array.find_all('number')

            try:

                point = array_data[0] ['value']

                rank = array_data[1] ['value']

                his_rank_list.append([rank, point, date])

                save_his_data(club_name, his_rank_list)

            except:

                raise

Copy the code

This gives us two files, club_data.csv and rank_his_data.csv

Club ranking

We’ve compiled a list of the top 20 clubs in the world, with Liverpool at the top with 2,120 points, followed by Manchester City.

Next up are Barcelona in the Spanish super League and Bundesliga champions Bayern Munich, the old lady who have won eight consecutive titles in Serie A and Gran Paris who are invincible in France.

The top five leagues in Europe

How about, come and see if you are familiar with the team logo list!

National distribution

Let’s take a look at which countries have the most clubs, starting with the distribution of the top 20 countries

As you can see, England and Spain have the most clubs on the list, with four each, followed by Italy and Germany, with three each, accounting for the majority. The only non-European club is in Brazil, and the football kingdom is proud.

Let’s expand the list to include all crawls, the top 200 clubs

Spain has the most clubs with 20, followed by England with 17. These years the Spanish Premier League teams monopolized the Champions League, or its profound football as a backing!

Spain, England, Germany, France and Italy, plus Argentina and Brazil, make up half of the list. It has never been the same.

Of course, the CSL also has two clubs on the list, Shanghai SiPG (133) and Guangzhou Evergrande (166). There is a long way to go.

Top7 ranking trends

The seven clubs, from the traditional giants of the continent to the up-and-comers, are among the top clubs of the day.

We can see that for “Emperor Saren”, their results are extremely stable, always in a very high level of competition. Liverpool, on the other hand, hit a low point in the first decade of this century.

Then there is jinyuan football represents a greater and a trip, including a greater especially, since 2011, thanks to Qatar consortium, its ranking began rising sharply, worldwide influence is also greatly increased, the record is constantly breakthroughs, perennial monopoly ligue 1 champions, but for the champions league, Paris is still a long way to go.

For the old strong Juventus, I believe everyone will think of the famous “calciopoli” incident, after this incident, not only Juventus fell to the bottom, but also Italian football, once the apennines league style, have gone forever. However, since 2011, Juve has been on the road to a Renaissance and also carried the banner of Italian football.

Ranking by continent

We can see from the above ranking that the so-called world ranking is mostly composed of European clubs, then what about clubs from other continents? Let’s take a look.

Asia

Africa

South America

Finally, let’s take a look at how the world’s top clubs have changed over the past decade

video

https://mp.weixin.qq.com/s/PJ8AS_OZJNWiyZ-GXCUnmg

Afterword.

In the twinkling of an eye, the Spring Festival is coming. I wish you all a happy Spring Festival!

This article may be the last original before the Spring Festival, due to my general level, limited ability, writing original is really not easy, we see and cherish it. If you feel ok, just point “watching”, as encouragement, thank you!