> For the complete documentation index, see [llms.txt](https://developers.oxylabs.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.oxylabs.io/products/cn/web-scraper-api/features/custom-parser/writing-instructions-manually.md).

# 手动编写指令

虽然自定义解析器通过 AI 驱动的功能帮助你自动化数据解析，但你也可以使用 CSS 和 XPath 表达式手动编写解析指令。这让你可以 **处理边缘情况** 或 **自定义解析逻辑** 以适应特定场景。

创建任务时，自定义解析器需要以下必填参数：

* `parse` 设置为 `true`
* `parsing_instructions` 其中包含一个带有提取规则的 JSON 对象

当你对自定义解析逻辑满意后，可以将这些指令保存为可复用的 [解析器预设](/products/cn/web-scraper-api/features/custom-parser/parser-presets.md).

请查看下面我们的完整指南，其中可以找到实用示例、XPath 表达式的最佳实践，以及所有可用解析函数的完整参考。

{% content-ref url="/pages/f0599592eb013357024a5311a8b39c2e63e3cf58" %}
[解析指令示例](/products/cn/web-scraper-api/features/custom-parser/writing-instructions-manually/parsing-instruction-examples.md)
{% endcontent-ref %}

{% content-ref url="/pages/3aac6fc9ec9d5f1b4b4bf87d5a05ad6b0991ceb6" %}
[编写 XPath 表达式的提示](/products/cn/web-scraper-api/features/custom-parser/writing-instructions-manually/tips-for-writing-xpath-expressions.md)
{% endcontent-ref %}

{% content-ref url="/pages/b210c7fde99e3f92815c49348b7c1d7ea1c4d44c" %}
[解析函数列表](/products/cn/web-scraper-api/features/custom-parser/writing-instructions-manually/list-of-functions.md)
{% endcontent-ref %}

{% content-ref url="/pages/4676fed76a7d4066f1f6f839e8d4da500d6ee701" %}
[解析函数示例](/products/cn/web-scraper-api/features/custom-parser/writing-instructions-manually/list-of-functions/function-examples.md)
{% endcontent-ref %}


---

# 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://developers.oxylabs.io/products/cn/web-scraper-api/features/custom-parser/writing-instructions-manually.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.
