Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Python climbs Douban movies and actor ratings and makes visualization pictures

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Python how to climb Douban movies and actor ratings and make visualization pictures, I believe that many inexperienced people do not know what to do, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

With the vigorous development of the film industry, more and more films appear in the audience's field of vision, enriching everyone's life, and good movies can also let everyone relax and harvest some thinking about life at the same time.

However, there are also some "bad movies" that make people "plug" after watching them, regret contributing to the box office for such "bad movies" and get the "IQ tax" for nothing. Today, we use Python to collect the IQ tax that has been harvested by bad movies for a few years.

Data acquisition

This time, the data source is also everyone's old friend, Douban, which is affectionately known as "Hornet's Nest". Now there are many platforms that will rate the movie, including Cat's Eye and Taobao, but in comparison, Douban's score is more comprehensive. Some unpopular "bad movies" can only be excavated in Douban.

Admittedly, there will be some "literary filters" in Douban's score, which is more tolerant of literary films. We believe that "Douban's high score is not necessarily really high, but Douban's low score is really low." The range of films selected this time is the domestic films from 2010 to the present:

Finally, the data of more than 3000 movies are obtained. The code is as follows:

# # crawling the drama list And output to excel form driver = webdriver.Chrome () driver.maximize_window () driver.close () driver.switch_to_window (driver.window_handles [0]) url = 'https://movie.douban.com/tag/#/?sort=U&range=2,10&tags=%E7%94%B5%E5%BD%B1,2010%E5%B9%B4%E4%BB%A3, % E4%B8%AD%E5%9B%BD%E5%A4%A7%E9%99%86'js='window.open ("'+ url+'") 'driver.execute_script (js) driver.close () driver.switch_to_window (driver.window_handles [0]) while True: try: js= "var q=document.documentElement.scrollTop=10000000" driver.execute_script (js) driver.find_element_by_class_name (' more') .click () Time.sleep (2) except: break name = [k.text for k in driver.find_elements_by_class_name ('title')] score = [k.text for k in driver.find_elements_by_class_name (' rate')] url = [k.get_attribute ('href') for k in driver.find_elements_by_class_name (' item')] pd.DataFrame ({'name':name) 'score':score,'url':url}) .to_excel (' movie name .xlsx') overall data

The first thing to do is to take a look at Douban's overall rating of domestic films, so as to determine the basis for the division of "bad films". First, take a look at the bar chart of the overall rating:

We can see that Douban users are still relatively strict with domestic films. Most films are scored at 6 points, and films with scores above 8 points can be said to be "rare". Therefore, the standard for bad films should be lowered accordingly. Let's take a look at the number of statistics after rounding down the scores:

The only movie that scored 9 points was "I'm not the God of Medicine," which was released in 18 years. I hope there will be more such excellent films in the future, and this expectation is well-founded. Let's take a look at the proportion of bad movies and non-bad movies every year:

We can see that in all the films, the ratings of the popular TOP10 are still good, and the wandering Earth, the God of Medicine and Nezha also do very well at the box office. Obviously, this is not what we need. Let's take a look at the popularity lists of bad movies and super bad movies:

Warm congratulations to "Shanghai Fortress" for mentioning the champion of the two popularity lists with a score of 2.9 points and 217110 comments. "Love apartment" is also on the list because of its "big bluff" marketing. I wonder if the upcoming "Love apartment 5" can restore some reputation for this series.

Box office rankings

Similarly, let's take a look at the box office rankings of all the films, bad movies and super bad movies to see which "bad movies" are frantically harvesting everyone's IQ tax. first, take a look at the box office rankings of the films:

The TOP10 in the box office list of bad movies has exceeded 260 million, and Tianzhu and Love apartment have reaped 750 million and 550 million of the box office respectively, frantically harvesting everyone's IQ tax. I believe that with the increase of people's requirements for the film in the future, the phenomenon of crazy harvest IQ tax will gradually decrease.

There is no need to repeat the actors with high ratings. They have all gone through the challenges of the market and the audience, but at present, there is no actor who can score 7 after starring in more than 5 films. it is true that part of the reason is Douban's strict requirements for domestic production, but on the other hand, it is also urging filmmakers to make continuous progress.

Let's take a look at the actors at the bottom of the list. Let's first take a look at BOTTOM10:

As too many "cross-border" actors appear on the list BOTTOM10, so many actors in everyone's mind do not appear on the list, so let's continue to watch BOTTOM11-20, this list seems a bit normal, but many names that should appear in TV series are also on the list.

It seems that there are differences between movies and TV dramas. Actors who can shine in TV dramas may not be able to perform as well in movies. Considering the addition of TV actors, continue to enlarge the list to BOTTOM21-30:

After reading the above, have you mastered how Python crawls Douban movies and actor ratings and how to make visual pictures? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report