From a0952dca8fd72621c270f3dec94742c3f66fda2b Mon Sep 17 00:00:00 2001 From: Karim shoair Date: Wed, 26 Mar 2025 05:28:28 +0200 Subject: [PATCH] docs: Updating the README to reflect the new changes --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3eebf98..7353659 100644 --- a/README.md +++ b/README.md @@ -217,11 +217,17 @@ or ``` Then continue your code as normal. -The available configuration arguments are: `auto_match`, `huge_tree`, `keep_comments`, `keep_cdata`, `storage`, and `storage_args`, which are the same ones you give to the `Adaptor` class. +The available configuration arguments are: `auto_match`, `huge_tree`, `keep_comments`, `keep_cdata`, `storage`, and `storage_args`, which are the same ones you give to the `Adaptor` class. You can display the current configuration anytime by running `.display_config()` Also, the `Response` object returned from all fetchers is the same as the `Adaptor` object except it has these added attributes: `status`, `reason`, `cookies`, `headers`, `history`, and `request_headers`. All `cookies`, `headers`, and `request_headers` are always of type `dictionary`. > [!NOTE] > The `auto_match` argument is enabled by default which is the one you should care about the most as you will see later. + +#### Set parser config per request +As you probably understood, the logic above for setting the parser config will work globally for all requests/fetches done through that class and it's intended. + +If your use case requires you to use different config for each request/fetch, then you can pass a dictionary to the request method (`fetch`/`get`/`post`/...) to an argument named `custom_config`. + ### Fetcher This class is built on top of [httpx](https://www.python-httpx.org/) with additional configuration options, here you can do `GET`, `POST`, `PUT`, and `DELETE` requests.