From 797f77cab6961eff1c7e34c3298e9bcec04fab28 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Thu, 2 Apr 2026 19:39:41 +0200 Subject: [PATCH 1/3] docs: fix typos, broken links, and add frontmatter descriptions Fix typos (missing spaces after commas, misspellings), broken README guide links, a code bug in README example, remove ty:ignore comments from doc code examples by using proper enum types, and add SEO description fields to all doc pages. Co-Authored-By: Claude Opus 4.6 (1M context) --- README.md | 7 ++++--- docs/01_introduction/index.mdx | 3 +-- docs/01_introduction/quick-start.mdx | 3 +-- docs/02_concepts/01_actor_lifecycle.mdx | 1 + docs/02_concepts/02_actor_input.mdx | 1 + docs/02_concepts/03_storages.mdx | 1 + docs/02_concepts/04_actor_events.mdx | 1 + docs/02_concepts/05_proxy_management.mdx | 3 ++- docs/02_concepts/06_interacting_with_other_actors.mdx | 5 +++-- docs/02_concepts/07_webhooks.mdx | 3 ++- docs/02_concepts/08_access_apify_api.mdx | 3 ++- docs/02_concepts/09_logging.mdx | 8 ++++---- docs/02_concepts/10_configuration.mdx | 5 +++-- docs/02_concepts/code/05_custom_proxy_function.py | 2 +- docs/02_concepts/code/07_webhook.py | 4 ++-- docs/02_concepts/code/07_webhook_preventing.py | 4 ++-- docs/03_guides/01_beautifulsoup_httpx.mdx | 1 + docs/03_guides/02_parsel_impit.mdx | 1 + docs/03_guides/03_playwright.mdx | 1 + docs/03_guides/04_selenium.mdx | 1 + docs/03_guides/05_crawlee.mdx | 1 + docs/03_guides/06_scrapy.mdx | 1 + docs/03_guides/07_running_webserver.mdx | 1 + docs/04_upgrading/upgrading_to_v2.md | 1 + docs/04_upgrading/upgrading_to_v3.md | 1 + pyproject.toml | 1 + uv.lock | 4 ++++ 27 files changed, 45 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index a34bacca..24cef390 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ async def main() -> None: # Extract the desired data. data = { - 'url': actor_input['url'], + 'url': request.url, 'title': soup.title.string, 'h1s': [h1.text for h1 in soup.find_all('h1')], 'h2s': [h2.text for h2 in soup.find_all('h2')], @@ -165,10 +165,11 @@ To create and run Python Actors locally, check the documentation for To see how you can use the Apify SDK with other popular libraries used for web scraping, check out our guides for using -[Requests and HTTPX](https://docs.apify.com/sdk/python/docs/guides/requests-and-httpx), -[Beautiful Soup](https://docs.apify.com/sdk/python/docs/guides/beautiful-soup), +[BeautifulSoup with HTTPX](https://docs.apify.com/sdk/python/docs/guides/beautifulsoup-httpx), +[Parsel with Impit](https://docs.apify.com/sdk/python/docs/guides/parsel-impit), [Playwright](https://docs.apify.com/sdk/python/docs/guides/playwright), [Selenium](https://docs.apify.com/sdk/python/docs/guides/selenium), +[Crawlee](https://docs.apify.com/sdk/python/docs/guides/crawlee), or [Scrapy](https://docs.apify.com/sdk/python/docs/guides/scrapy). ## Usage concepts diff --git a/docs/01_introduction/index.mdx b/docs/01_introduction/index.mdx index 066687c4..2e803979 100644 --- a/docs/01_introduction/index.mdx +++ b/docs/01_introduction/index.mdx @@ -1,9 +1,8 @@ --- id: introduction title: Overview -sidebar_label: Overview slug: /overview -description: 'The official library for creating Apify Actors in Python, providing tools for web scraping, automation, and data storage integration.' +description: The official library for creating Apify Actors in Python, providing tools for web scraping, automation, and data storage integration. --- import CodeBlock from '@theme/CodeBlock'; diff --git a/docs/01_introduction/quick-start.mdx b/docs/01_introduction/quick-start.mdx index 1e568c5b..da166da9 100644 --- a/docs/01_introduction/quick-start.mdx +++ b/docs/01_introduction/quick-start.mdx @@ -1,8 +1,7 @@ --- id: quick-start title: Quick start -sidebar_label: Quick start -description: 'Get started with the Apify SDK for Python by creating your first Actor and learning the basics.' +description: Get started with the Apify SDK for Python by creating your first Actor and learning the basics. --- Learn how to create and run Actors using the Apify SDK for Python. diff --git a/docs/02_concepts/01_actor_lifecycle.mdx b/docs/02_concepts/01_actor_lifecycle.mdx index bf07cf5d..5d2ebb28 100644 --- a/docs/02_concepts/01_actor_lifecycle.mdx +++ b/docs/02_concepts/01_actor_lifecycle.mdx @@ -1,6 +1,7 @@ --- id: actor-lifecycle title: Actor lifecycle +description: How an Apify Actor starts, runs, and shuts down, including context manager and manual control patterns. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; diff --git a/docs/02_concepts/02_actor_input.mdx b/docs/02_concepts/02_actor_input.mdx index 3a4deabb..5a0e9ecc 100644 --- a/docs/02_concepts/02_actor_input.mdx +++ b/docs/02_concepts/02_actor_input.mdx @@ -1,6 +1,7 @@ --- id: actor-input title: Actor input +description: Read and validate input data passed to your Actor at runtime. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; diff --git a/docs/02_concepts/03_storages.mdx b/docs/02_concepts/03_storages.mdx index 193ce36f..17fe6088 100644 --- a/docs/02_concepts/03_storages.mdx +++ b/docs/02_concepts/03_storages.mdx @@ -1,6 +1,7 @@ --- id: storages title: Working with storages +description: Use datasets, key-value stores, and request queues to persist Actor data. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; diff --git a/docs/02_concepts/04_actor_events.mdx b/docs/02_concepts/04_actor_events.mdx index 9ce7fd59..83343f28 100644 --- a/docs/02_concepts/04_actor_events.mdx +++ b/docs/02_concepts/04_actor_events.mdx @@ -1,6 +1,7 @@ --- id: actor-events title: Actor events & state persistence +description: Handle platform events like state persistence and graceful shutdown in your Actors. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; diff --git a/docs/02_concepts/05_proxy_management.mdx b/docs/02_concepts/05_proxy_management.mdx index 64420eee..8579d5da 100644 --- a/docs/02_concepts/05_proxy_management.mdx +++ b/docs/02_concepts/05_proxy_management.mdx @@ -1,6 +1,7 @@ --- id: proxy-management title: Proxy management +description: Configure Apify Proxy or your own proxies for IP rotation and session management. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; @@ -39,7 +40,7 @@ All your proxy needs are managed by the [`ProxyConfiguration`](../../reference/c ### Apify proxy vs. your own proxies -The `ProxyConfiguration` class covers both Apify Proxy and custom proxy URLs, so that you can easily switch between proxy providers. However, some features of the class are available only to Apify Proxy users, mainly because Apify Proxy is what one would call a super-proxy. It's not a single proxy server, but an API endpoint that allows connectionthrough millions of different IP addresses. So the class essentially has two modes: Apify Proxy or Your proxy. +The `ProxyConfiguration` class covers both Apify Proxy and custom proxy URLs, so that you can easily switch between proxy providers. However, some features of the class are available only to Apify Proxy users, mainly because Apify Proxy is what one would call a super-proxy. It's not a single proxy server, but an API endpoint that allows connection through millions of different IP addresses. So the class essentially has two modes: Apify Proxy or Your proxy. The difference is easy to remember. Using the `proxy_url` or `new_url_function` arguments enables use of your custom proxy URLs, whereas all the other options are there to configure Apify Proxy. Visit the [Apify Proxy docs](https://docs.apify.com/proxy) for more info on how these parameters work. diff --git a/docs/02_concepts/06_interacting_with_other_actors.mdx b/docs/02_concepts/06_interacting_with_other_actors.mdx index 880cbb89..086081af 100644 --- a/docs/02_concepts/06_interacting_with_other_actors.mdx +++ b/docs/02_concepts/06_interacting_with_other_actors.mdx @@ -1,6 +1,7 @@ --- id: interacting-with-other-actors title: Interacting with other Actors +description: Start, call, and metamorph other Actors from within your Actor code. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; @@ -40,9 +41,9 @@ The [`Actor.call_task`](../../reference/class/Actor#call_task) method starts an The [`Actor.metamorph`](../../reference/class/Actor#metamorph) operation transforms an Actor run into a run of another Actor with a new input. This feature is useful if you want to use another Actor to finish the work of your current Actor, instead of internally starting a new Actor run and waiting for its finish. With metamorph, you can easily create new Actors on top of existing ones, and give your users nicer input structure and user interface for the final Actor. For the users of your Actors, the metamorph operation is completely transparent; they will just see your Actor got the work done. -Internally, the system stops the container corresponding to the original Actor run and starts a new container using a different container image. All the default storages are preserved,and the new Actor input is stored under the `INPUT-METAMORPH-1` key in the same default key-value store. +Internally, the system stops the container corresponding to the original Actor run and starts a new container using a different container image. All the default storages are preserved, and the new Actor input is stored under the `INPUT-METAMORPH-1` key in the same default key-value store. -To make you Actor compatible with the metamorph operation, use [`Actor.get_input`](../../reference/class/Actor#get_input) instead of [`Actor.get_value('INPUT')`](../../reference/class/Actor#get_value) to read your Actor input. This method will fetch the input using the right key in a case of metamorphed run. +To make your Actor compatible with the metamorph operation, use [`Actor.get_input`](../../reference/class/Actor#get_input) instead of [`Actor.get_value('INPUT')`](../../reference/class/Actor#get_value) to read your Actor input. This method will fetch the input using the right key in a case of metamorphed run. For example, imagine you have an Actor that accepts a hotel URL on input, and then internally uses the [`apify/web-scraper`](https://apify.com/apify/web-scraper) public Actor to scrape all the hotel reviews. The metamorphing code would look as follows: diff --git a/docs/02_concepts/07_webhooks.mdx b/docs/02_concepts/07_webhooks.mdx index 04697bbb..12823b63 100644 --- a/docs/02_concepts/07_webhooks.mdx +++ b/docs/02_concepts/07_webhooks.mdx @@ -1,6 +1,7 @@ --- id: webhooks title: Creating webhooks +description: Set up webhooks to trigger actions when Actor run events occur. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; @@ -14,7 +15,7 @@ You can learn more in the [documentation for webhooks](https://docs.apify.com/pl ## Creating an ad-hoc webhook dynamically -Besides creating webhooks manually in Apify Console, or through the Apify API,you can also create [ad-hoc webhooks](https://docs.apify.com/platform/integrations/webhooks/ad-hoc-webhooks) dynamically from the code of your Actor using the [`Actor.add_webhook`](../../reference/class/Actor#add_webhook) method: +Besides creating webhooks manually in Apify Console, or through the Apify API, you can also create [ad-hoc webhooks](https://docs.apify.com/platform/integrations/webhooks/ad-hoc-webhooks) dynamically from the code of your Actor using the [`Actor.add_webhook`](../../reference/class/Actor#add_webhook) method: {WebhookExample} diff --git a/docs/02_concepts/08_access_apify_api.mdx b/docs/02_concepts/08_access_apify_api.mdx index ff6fefb1..c4d9bc35 100644 --- a/docs/02_concepts/08_access_apify_api.mdx +++ b/docs/02_concepts/08_access_apify_api.mdx @@ -1,6 +1,7 @@ --- id: access-apify-api title: Accessing Apify API +description: Use the built-in Apify API client to access platform features not covered by the SDK. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; @@ -24,7 +25,7 @@ For example, to get the details of your user, you can use this snippet: ## Actor new client -If you want to create a completely new instance of the client, for example, to get a client for a different user or change the configuration of the client,you can use the [`Actor.new_client`](../../reference/class/Actor#new_client) method: +If you want to create a completely new instance of the client, for example, to get a client for a different user or change the configuration of the client, you can use the [`Actor.new_client`](../../reference/class/Actor#new_client) method: {ActorNewClientExample} diff --git a/docs/02_concepts/09_logging.mdx b/docs/02_concepts/09_logging.mdx index c1bd26c6..5a632cd9 100644 --- a/docs/02_concepts/09_logging.mdx +++ b/docs/02_concepts/09_logging.mdx @@ -1,6 +1,7 @@ --- id: logging title: Logging +description: Configure log levels, formatting, and log redirection between Actor runs. --- import RunnableCodeBlock from '@site/src/components/RunnableCodeBlock'; @@ -14,7 +15,7 @@ The Apify SDK is logging useful information through the [`logging`](https://docs ## Automatic configuration -When you create an Actor from an Apify-provided template, either in Apify Console or through the Apify CLI, you do not have to configure the logger yourself. The template already contains initialization code for the logger,which sets the logger level to `DEBUG` and the log formatter to [`ActorLogFormatter`](../../reference/class/ActorLogFormatter). +When you create an Actor from an Apify-provided template, either in Apify Console or through the Apify CLI, you do not have to configure the logger yourself. The template already contains initialization code for the logger, which sets the logger level to `DEBUG` and the log formatter to [`ActorLogFormatter`](../../reference/class/ActorLogFormatter). ## Manual configuration @@ -24,7 +25,7 @@ In Python's default behavior, if you don't configure the logger otherwise, only ### Configuring the log formatting -By default, only the log message is printed out to the output, without any formatting. To have a nicer output, with the log level printed in color, the messages nicely aligned, and extra log fields printed out,you can use the [`ActorLogFormatter`](../../reference/class/ActorLogFormatter) class from the `apify.log` module. +By default, only the log message is printed out to the output, without any formatting. To have a nicer output, with the log level printed in color, the messages nicely aligned, and extra log fields printed out, you can use the [`ActorLogFormatter`](../../reference/class/ActorLogFormatter) class from the `apify.log` module. ### Example log configuration @@ -40,7 +41,7 @@ This configuration will cause all levels of messages to be printed to the standa Here you can see how all the log levels would look like. -You can use the `extra` argument for all log levels, it's not specific to the warning level. When you use `Logger.exception`, there is no need to pass the Exception object to the log manually, it will automatiacally infer it from the current execution context and print the exception details. +You can use the `extra` argument for all log levels, it's not specific to the warning level. When you use `Logger.exception`, there is no need to pass the Exception object to the log manually, it will automatically infer it from the current execution context and print the exception details. {LoggerUsageExample} @@ -48,7 +49,6 @@ You can use the `extra` argument for all log levels, it's not specific to the wa Result: -