# 如何使用爬蟲（爬取資料）功能

## 功能用途與價值 <a href="#feature-purpose-and-value" id="feature-purpose-and-value"></a>

身為企業人員，可能經常會接到長官指示，需要參考或彙整某些公開網站上的法規資料。

若具備技術背景，或有工程人員協助，或許可以透過撰寫爬蟲程式自動擷取資料；但對於非技術人員而言，通常只能手動一頁頁整理，不僅耗時費力，還容易遺漏關鍵資訊。

此時，您可以善用 MaiAgent 的爬蟲功能，透過 No-Code（免寫程式）方式，快速擷取網站內容，自動建立結構化資料，大幅提升資訊整理效率，將您的時間投入在更高價值的核心業務上。

## 如何進行爬蟲？ <a href="#how-to-scrape" id="how-to-scrape"></a>

想要建立爬蟲請求，您可以：

1. 建立頁面爬取請求

進入左側功能欄 「<mark style="color:blue;">AI 功能 > AI 助理 > 爬蟲</mark>」 ，點選右上方的 「<mark style="color:blue;">+建立頁面爬取請求</mark>」 按鈕。

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

2. 輸入網址

輸入您要爬取頁面的網址，並按下 \[<mark style="color:blue;">確認</mark>] 按鈕。

{% hint style="warning" %}

* 請注意，網址不可超過 200 字
* 若狀態一直未改變，可以按右上角重新整理頁面更新狀態
  {% endhint %}

<div><figure><img src="/files/nLemSGxJXStwA9xMtD1G" alt=""><figcaption></figcaption></figure> <figure><img src="/files/smgDfD45UQUi9dOwwuoD" alt=""><figcaption></figcaption></figure></div>

3. 檢視爬蟲資料

當狀態顯示完成後，點入右方的「匯入」，檢視爬完的資料條目。

4. 選取資料

勾選左方的方塊，選擇您想要匯入知識庫的資料。勾選完畢後再按下 「<mark style="color:blue;">匯入</mark>」 按鈕，資料將會自動匯入到該 AI 助理的知識庫。

{% hint style="info" %}
如想在同一個頁面瀏覽更多資料條目，可點選右下方的 「<mark style="color:blue;">10條/頁</mark>」來擴大瀏覽範圍。
{% endhint %}

<div><figure><img src="/files/KTkWG12FjwIEfxjWQVRk" alt=""><figcaption></figcaption></figure> <figure><img src="/files/UX4PrYPGImLIQPElJ6us" alt=""><figcaption></figcaption></figure></div>

在知識庫中就可以看到以 .md 檔呈現的資料，和一般資料一樣可以進行標籤、元資料的設定。

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

## 爬蟲使用注意事項 <a href="#scraping-considerations" id="scraping-considerations"></a>

* 請確保您有權限爬取目標網站內容
* 建議先測試小範圍資料再進行大量爬取
* 爬取完成後可透過[搜尋測試功能](/km/test-search-result.md)驗證資料品質
* 定期更新爬蟲資料以保持資訊時效性


---

# 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://docs.maiagent.ai/km/scrape-website.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.
