> For the complete documentation index, see [llms.txt](https://410521206.gitbook.io/python-ws/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://410521206.gitbook.io/python-ws/080501-top-100-movies-collection.md).

# 080501 - Top 100 Movies Collection

### 題目敘述 Problems Description:

克里斯托弗是位就讀電影研究相關科系的學生，他需蒐集不同種類電影的各排名前100名才能得到足夠的資料庫研究，但手動一個一個複製貼上太慢了，請幫他寫一個網路爬蟲程式，讓他可以快速地得到排名前100名的電影及其他資訊。

Christopher is a student in cinema and media studies. He needs to collect the top 100 rankings of different kind of movies to get enough database research, but it is too slow to copy and paste one by one manually. Please help him to write a web scraping program that allows him to get the top 100 movies and other necessary information quickly.

### 輸入說明 Input Description:

請利用 **正規表示式** 分析並抓取每種前100名電影的所有`Rank`、`Rating`、`Title`、`No. of Reviews`。

Please use specifically **regular expression** to analyze and capture all the `Rank`, `Rating`, `Title`, and `No. of Reviews` of each top 100 movies.

[<<< Top 100 Moive Website >>>](https://www.rottentomatoes.com/top/)

![](https://i.imgur.com/VDZgms9.png)

### 輸出說明 Output Description:

請檢查`./src/top100/{your name}`是否存在，若沒有請自行創建。此外，請將爬取到的資料以 **DataFrame**的形式存成 **CSV File**並存在剛剛的`./src/top100/{your name}`中(使用 **Pandas**)。而CSV檔的名稱必須為種類的名稱。

Please create a folder `./src/top100/{your name}` if the folder doesn't exists, and save the received data in the form of **DataFrame** as **CSV File** (use **Pandas**) inside the folder. CSV file names must be related with the genres.

![](https://i.imgur.com/P4KvGAf.png)

### 輸入範例 Input Example:

![](https://i.imgur.com/DffbWCB.png)

### 輸出範例 Output Example:

![](https://i.imgur.com/u3IDCuX.png)

### 提示 Hint:

{% hint style="warning" %}
只能使用 `Requests Library` 以及 `Regex Library` 來實現爬蟲！\
You can only use `Requests Library` and `Regex Library` to implement the web scraping.
{% endhint %}
