> 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/web-scraper-api/features/custom-parser/writing-instructions-manually.md).

# Writing instructions manually

See how to write parsing instructions manually to handle edge cases or customize parsing logic.

While Custom Parser helps you automate data parsing with AI-powered features, you can also write parsing instructions manually using CSS and XPath expressions. This gives you the option to **handle edge cases** or **customize parsing logic** for specific scenarios.

Custom Parser requires these mandatory parameters when creating a job:

* `parse` set to `true`
* `parsing_instructions` containing a JSON object with your extraction rules

Once you're happy with your custom parsing logic, you can save the instructions as a reusable [parser preset](/products/web-scraper-api/features/custom-parser/parser-presets.md).

Check out our comprehensive guides below, where you can find practical examples, best practices for XPath expressions, and a complete reference of all available parsing functions.

{% content-ref url="/pages/oxrwg37AyLWH1P5TPzwI" %}
[Parsing instruction examples](/products/web-scraper-api/features/custom-parser/writing-instructions-manually/parsing-instruction-examples.md)
{% endcontent-ref %}

{% content-ref url="/pages/z3HuH3Sn6WT2loO8bw5e" %}
[Tips for writing XPath expressions](/products/web-scraper-api/features/custom-parser/writing-instructions-manually/tips-for-writing-xpath-expressions.md)
{% endcontent-ref %}

{% content-ref url="/pages/751P6A1HZSfgMAhsniMo" %}
[List of parsing functions](/products/web-scraper-api/features/custom-parser/writing-instructions-manually/list-of-functions.md)
{% endcontent-ref %}

{% content-ref url="/pages/LWprqEz9Iwufi0fbGjXn" %}
[Parsing function examples](/products/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.oxylabs.io/products/web-scraper-api/features/custom-parser/writing-instructions-manually.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
