# 設定 - 分頁範本

## 分頁範本是什麼？

<figure><img src="/files/f47549789e8b688b030a5b41225e5e8f9a20868a" alt=""><figcaption></figcaption></figure>

* 可以重現滑鼠、鍵盤動作的功能。
* 使用者只需設定幾個值，就能在所有網站上運作。
* 持續新增新範本。

{% hint style="success" %}

### 分頁是什麼？

載入下一頁資料最典型的方法。由數字（或文字）顯示的頁面按鈕組成，要移至下一頁，點擊數字或特定按鈕的方式。

如果每頁都可以用獨立的 URL 直接存取，可以使用[**群組提取**](https://help.listly.io/docs/ko/getting-started/result-page-features/group-extraction)功能。但是，

<mark style="color:red;">**1. 移動頁面時 URL 不變的情況**</mark>

<mark style="color:red;">**2. 即使存取特定頁面的 URL 也會自動移至第一頁的情況**</mark>

在上述環境中，請用**分頁範本**解決問題 🙂
{% endhint %}

{% hint style="warning" %}
分頁範本是可以套用到個別任務的設定，**個別任務約有 10 分鐘的收集時間限制**。\
因為這個限制，如果輸入的頁面數量太多，可能只能提取到中間。此外，使用分頁在收集時間內可提取的頁面數量會根據每頁包含的資料量而有所不同。

* 例如，在包含大量圖片的 A 網站中，在執行時間內只提取到 24 頁。
* 相反，在以文字為主的 B 網站中，正常提取到 110 頁。

即，每頁的資料容量和結構不同，可提取範圍也會不同，請務必參考這一點。通常 100 頁左右的規模適合使用分頁範本。

[**Q. 為什麼有收集時間 10 分鐘限制？**](https://help.listly.io/docs/ko/support/faq/and/10)
{% endhint %}

***

## 使用方法

{% stepper %}
{% step %}

### 確認分頁類型

請參考下方類型分類，確認要提取的網頁的分頁性質。

確認「下一頁」按鈕（用箭頭（▶️）或「下一頁」「Next」等表示）的存在與否，以及點擊該按鈕時頁面如何移動。請用功能確認，不是設計！

***

<div align="left"><figure><img src="/files/d8dcd09912af3c0bf382a1707fd1ee6564bc7a81" alt=""><figcaption></figcaption></figure></div>

TYPE 1. 點擊時**立即移至下一頁（1→2）的按鈕存在**

<div align="left"><figure><img src="/files/2dc54b657f66a4bb550c49d0c9eed3e786f28f07" alt=""><figcaption></figcaption></figure></div>

TYPE 2. 點擊時立即移至下一頁的按鈕**不存在**，只有\*\*移至下一組（1→N）\*\*的按鈕

<div align="left"><figure><img src="/files/f32f0cdeffd420158d31bf4530159bb589bca382" alt=""><figcaption></figcaption></figure></div>

TYPE 3. **頁碼外**沒有移至下一頁或群組的按鈕

<div align="left"><figure><img src="/files/57fce7fcad671de55d0900bf049e6ed992bc3e65" alt=""><figcaption></figcaption></figure></div>

TYPE 4. 沒有頁碼，只有**移至上一頁/下一頁的按鈕**

***

**以 A 購物網站為例確認步驟。**

<figure><img src="/files/ebb2783ce35e5eb266d61df34f7ea8849e9726e8" alt=""><figcaption></figcaption></figure>

在頁面底部的分頁中點擊「下一頁」按鈕，從第 1 頁直接移至第 11 頁，即移至下一組。可以知道這個頁面對應上述項目中的 <mark style="background-color:$success;">**TYPE 2**</mark>。
{% endstep %}

{% step %}

### 提取第一頁

<figure><img src="/files/7a8c3c4912167dbc3843ea457e0047036fc5c491" alt=""><figcaption></figcaption></figure>

請提取分頁開始的第 1 頁。

{% hint style="success" %}
**這裡有個小技巧！** 選擇全頁（WHOLE）/部分（PART）都可以，但如果一次提取多頁，選擇\*\*「部分（PART）」\*\*可以提高準確度。🙂
{% endhint %}
{% endstep %}

{% step %}

### 前往作業設定

<figure><img src="/files/3644166a7c8b051d59203c96fea633bfcdef2d5c" alt=""><figcaption></figcaption></figure>

在結果頁面確認提取的資料。A 網站的一頁有 80 個資料。點擊頂部的 Browser Settings 前往該任務的設定視窗。
{% endstep %}

{% step %}

### 設定範本

<figure><img src="/files/5d5ad01d894ffa63006d3decdb39e6e5936cdad2" alt=""><figcaption></figcaption></figure>

<mark style="background-color:$success;">**A) 新增操作範本**</mark> 在設定最底部的 **ACTION TEMPLATE** 中點擊 **+ADD** 按鈕。\
該設定的表現和設計可能會在未來變更，但套用方式相同。

<figure><img src="/files/d7519c83f13005fc85394c53075ba4b1433bfeee" alt=""><figcaption></figcaption></figure>

<mark style="background-color:$success;">**B) 選擇分頁類型**</mark> 參考步驟 1 說明選擇要套用的範本。A 網站的案例是 <mark style="background-color:red;">**Pagination Type2**</mark>。

<figure><img src="/files/6fa9df810b3dbf48b4984c099a6a1e798f62cd8c" alt=""><figcaption></figcaption></figure>

<mark style="background-color:$success;">**C) 輸入變數**</mark> 填入圖片中的 <mark style="background-color:red;">**①**</mark>**,&#x20;**<mark style="background-color:purple;">**②**</mark>, <mark style="background-color:yellow;">**③**</mark> 項目。

<mark style="background-color:red;">**① 該範本的操作要重複幾次**</mark> 輸入 5 時，移至下一頁的動作會重複 5 次，因此會提取到第 6 頁。如果想提取到第 10 頁，請輸入 9。

<mark style="background-color:purple;">**② 當前頁碼的 CSS 選擇器值**</mark> 如圖片顯示的部分，在網站分頁的「當前頁面」編號上點擊滑鼠右鍵選擇後，參考[複製貼上 CSS 選擇器](https://help.listly.io/docs/ko/listly-basics/css-selector#a1)輸入該值。

<mark style="background-color:yellow;">**③ 「下一頁」按鈕的 CSS 選擇器值**</mark> 如圖片顯示的部分，在網站分頁的「下一頁」按鈕上點擊滑鼠右鍵選擇後，參考[複製貼上 CSS 選擇器](https://app.gitbook.com/o/Uu6AM3fgpZza0EpsJM4N/s/iKxoYELFf9WS8XCvYe6S/getting-started/listly-basics/css#a1)輸入該值。

輸入完所有項目後，點擊 <mark style="color:red;">`新增（Add）`</mark> → <mark style="color:red;">`儲存（Save）`</mark> 按鈕儲存設定。

**其他分頁類型的套用方式相同。根據各情況確認分頁類型，複製貼上 CSS 選擇器值即可。**
{% endstep %}

{% step %}

### 點擊重新提取並確認資料

<figure><img src="/files/0c327ddb13e3d723492afdb48a3d37c0de535428" alt=""><figcaption></figcaption></figure>

儲存設定後<mark style="color:red;">**務必點擊重新提取按鈕**</mark>以套用設定重新提取。

<figure><img src="/files/2de836d5554ee9b86babc3078aaf48512de18e20" alt=""><figcaption></figcaption></figure>

每頁 80 個，共 6 頁的 480 個資料被提取。

使用範本高效提取分散在多頁的資訊吧 😊
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.listly.io/docs/zh-hant/getting-started/databoard-features/settings-pagination-templates-zh-hant.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
