> For the complete documentation index, see [llms.txt](https://doc.thordata.com/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.thordata.com/doc/zh-hk/web-scraper-api/ding-shi-qi.md).

# 定時器

了解如何自動啟動 Web Scraper API 任務，以及 Cron 表達式的基本知識。

您可以通過 Thordata 儀表板設置和管理您的任務計劃，指定 Web Scraper API 在特定時間或按照特定規則自動運行。使用 Cron 表達式，您可以靈活地安排任務的運行頻率。

{% hint style="info" %}
**注意：**\
在大多數情況下，定時任務會在預定時間的一秒內觸發，但由於系統或伺服器原因，任務可能會有輕微延遲。
{% endhint %}

**設置新的定時任務**

進入定時器：\
首先您需要先進入“定時器”頁面，然後點擊頁面左上角 \[創建定時任務] 按鈕，即可進入設置定時任務頁面。

<div align="left"><figure><img src="/files/QbuwjWhSaM2PQlAilNFe" alt="" width="563"><figcaption></figcaption></figure></div>

配置定時任務：

* 定時任務名稱： 您可以自定義計劃任務的名稱，以便更容易進行管理。
* 定時設置：定時計劃設置工具使用 Cron 表達式來指定運行時間。如果您熟悉如何使用 Cron 表達式，可以直接開始使用。如果您不熟悉 Cron 表達式，也不用擔心--該設置工具提供了一個可視化的自定義配置頁面，包括按分鐘、小時、天、周或月設置的工具。它提供了與 Cron 表達式類似的調度功能，儘管功能不然 Cron 表達式強大，但您仍然可以直接自定義並設置定時計劃。
* 選擇抓取 API ： 選擇目標抓取 API 並配置要抓取的內容。
* 最後點擊 \[確定] 即可。

<div align="left"><figure><img src="/files/gZTcnD0m9CsNdC5DZHft" alt="" width="563"><figcaption></figcaption></figure></div>

**Cron：**\
標準 Cron 表達式（5 位）用於指定任務的執行時間，表達式格式為：分鐘 小時 天 月份 星期，共由五個字段組成。

參數：

<table><thead><tr><th width="79">位數</th><th width="86">名稱</th><th>取值範圍</th><th>定義</th></tr></thead><tbody><tr><td>1</td><td>分鐘</td><td>0-59</td><td>每小時的第幾分鐘</td></tr><tr><td>2</td><td>小時</td><td>0-23</td><td>每天的第幾小時</td></tr><tr><td>3</td><td>日</td><td>1-31 或者？</td><td>每月的第幾天</td></tr><tr><td>4</td><td>月</td><td>1-12</td><td>每年的第幾月</td></tr><tr><td>5</td><td>星期</td><td>0-7（0 和 7 都代表星期天）或者？</td><td>每周的星期幾</td></tr></tbody></table>

例子：\
`0 8 * * 1-5`\
表示：在每個周一到周五的每天早上 8 點整執行抓取任務。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://doc.thordata.com/doc/zh-hk/web-scraper-api/ding-shi-qi.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.
