Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions docs/01_introduction/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import UnderscoreMainExample from '!!raw-loader!./code/actor_structure/__main__.

## Step 1: Create Actors

To create and run Actors in [Apify Console](https://docs.apify.com/platform/console), refer to the [Console documentation](/platform/actors/development/quick-start/web-ide).
To create and run Actors in [Apify Console](https://docs.apify.com/platform/console), refer to the [Console documentation](https://docs.apify.com/platform/actors/development/quick-start/web-ide).

To create a new Apify Actor on your computer, you can use the [Apify CLI](/cli), and select one of the [Python Actor templates](https://apify.com/templates?category=python).

Expand Down Expand Up @@ -53,7 +53,7 @@ The Actor input, for example, will be in `storage/key_value_stores/default/INPUT

All Python Actor templates follow the same structure.

The `.actor` directory contains the [Actor configuration](/platform/actors/development/actor-config), such as the Actor's definition and input schema, and the Dockerfile necessary to run the Actor on the Apify platform.
The `.actor` directory contains the [Actor configuration](https://docs.apify.com/platform/actors/development/actor-config), such as the Actor's definition and input schema, and the Dockerfile necessary to run the Actor on the Apify platform.

The Actor's runtime dependencies are specified in the `requirements.txt` file, which follows the [standard requirements file format](https://pip.pypa.io/en/stable/reference/requirements-file-format/).

Expand Down Expand Up @@ -86,35 +86,35 @@ Now that you can create and run an Actor locally, explore the rest of the SDK's

To learn more about the features of the Apify SDK and how to use them, check out the Concepts section in the sidebar:

- [Actor lifecycle](../concepts/actor-lifecycle)
- [Actor input](../concepts/actor-input)
- [Storages](../concepts/storages)
- [Actor events & state persistence](../concepts/actor-events)
- [Proxy management](../concepts/proxy-management)
- [Interacting with other Actors](../concepts/interacting-with-other-actors)
- [Creating webhooks](../concepts/webhooks)
- [Accessing Apify API](../concepts/access-apify-api)
- [Logging](../concepts/logging)
- [Actor configuration](../concepts/actor-configuration)
- [Pay-per-event monetization](../concepts/pay-per-event)
- [Storage clients](../concepts/storage-clients)
- [Actor lifecycle](./concepts/actor-lifecycle)
- [Actor input](./concepts/actor-input)
- [Storages](./concepts/storages)
- [Actor events & state persistence](./concepts/actor-events)
- [Proxy management](./concepts/proxy-management)
- [Interacting with other Actors](./concepts/interacting-with-other-actors)
- [Creating webhooks](./concepts/webhooks)
- [Accessing Apify API](./concepts/access-apify-api)
- [Logging](./concepts/logging)
- [Actor configuration](./concepts/actor-configuration)
- [Pay-per-event monetization](./concepts/pay-per-event)
- [Storage clients](./concepts/storage-clients)

### Guides

To see how you can integrate the Apify SDK with popular scraping libraries and frameworks, check out these guides:

- [Scraping with BeautifulSoup and HTTPX](../guides/beautifulsoup-httpx)
- [Scraping with Parsel and Impit](../guides/parsel-impit)
- [Browser automation with Playwright](../guides/playwright)
- [Browser automation with Selenium](../guides/selenium)
- [Building crawlers with Crawlee](../guides/crawlee)
- [Building crawlers with Scrapy](../guides/scrapy)
- [Adaptive scraping with Scrapling](../guides/scrapling)
- [LLM-ready scraping with Crawl4AI](../guides/crawl4ai)
- [Browser AI agents with Browser Use](../guides/browser-use)
- [Scraping with BeautifulSoup and HTTPX](./guides/beautifulsoup-httpx)
- [Scraping with Parsel and Impit](./guides/parsel-impit)
- [Browser automation with Playwright](./guides/playwright)
- [Browser automation with Selenium](./guides/selenium)
- [Building crawlers with Crawlee](./guides/crawlee)
- [Building crawlers with Scrapy](./guides/scrapy)
- [Adaptive scraping with Scrapling](./guides/scrapling)
- [LLM-ready scraping with Crawl4AI](./guides/crawl4ai)
- [Browser AI agents with Browser Use](./guides/browser-use)

For other aspects of Actor development, explore these guides:

- [Project management with uv](../guides/uv)
- [Input validation with Pydantic](../guides/input-validation)
- [Running a web server](../guides/running-webserver)
- [Project management with uv](./guides/uv)
- [Input validation with Pydantic](./guides/input-validation)
- [Running a web server](./guides/running-webserver)
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ If you want to modify the Actor structure, you need to make sure that your Actor

To learn more about the features of the Apify SDK and how to use them, check out the Concepts section, especially:

- [Actor lifecycle](../concepts/actor-lifecycle)
- [Working with storages](../concepts/storages)
- [Working with proxies](../concepts/proxy-management)
- [Managing Actor events](../concepts/actor-events)
- [Direct access to the Apify API](../concepts/access-apify-api)
- [Actor lifecycle](./concepts/actor-lifecycle)
- [Working with storages](./concepts/storages)
- [Working with proxies](./concepts/proxy-management)
- [Managing Actor events](./concepts/actor-events)
- [Direct access to the Apify API](./concepts/access-apify-api)
34 changes: 17 additions & 17 deletions website/versioned_docs/version-1.7/01-introduction/quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The Actor's runtime dependencies are specified in the `requirements.txt` file, w
The Actor's source code is in the `src` folder. This folder contains two important files:

- `main.py` - which contains the main function of the Actor
- `__main__.py` - which is the entrypoint of the Actor package, setting up the Actor [logger](../concepts/logging) and executing the Actor's main function via [`asyncio.run()`](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run).
- `__main__.py` - which is the entrypoint of the Actor package, setting up the Actor [logger](./concepts/logging) and executing the Actor's main function via [`asyncio.run()`](https://docs.python.org/3/library/asyncio-runner.html#asyncio.run).

<Tabs>
<TabItem value="main.py" label="main.py" default>
Expand Down Expand Up @@ -109,24 +109,24 @@ python -m pip install -r requirements.txt

To learn more about the features of the Apify SDK and how to use them, check out the Concepts section in the sidebar:

- [Actor lifecycle](../concepts/actor-lifecycle)
- [Actor input](../concepts/actor-input)
- [Working with storages](../concepts/storages)
- [Handling Actor events & persisting state](../concepts/actor-events)
- [Proxy management](../concepts/proxy-management)
- [Interacting with other Actors](../concepts/interacting-with-other-actors)
- [Creating webhooks](../concepts/webhooks)
- [Accessing the Apify API](../concepts/access-apify-api)
- [Logging](../concepts/logging)
- [Actor configuration and environment variables](../concepts/configuration)
- [Actor lifecycle](./concepts/actor-lifecycle)
- [Actor input](./concepts/actor-input)
- [Working with storages](./concepts/storages)
- [Handling Actor events & persisting state](./concepts/actor-events)
- [Proxy management](./concepts/proxy-management)
- [Interacting with other Actors](./concepts/interacting-with-other-actors)
- [Creating webhooks](./concepts/webhooks)
- [Accessing the Apify API](./concepts/access-apify-api)
- [Logging](./concepts/logging)
- [Actor configuration and environment variables](./concepts/configuration)

### Guides

To see how you can integrate the Apify SDK with popular web scraping libraries, check out our guides:

- [Requests and HTTPX](../guides/requests-and-httpx)
- [Beautiful Soup](../guides/beautiful-soup)
- [Playwright](../guides/playwright)
- [Selenium](../guides/selenium)
- [Scrapy](../guides/scrapy)
- [Running webserver](../guides/running-webserver)
- [Requests and HTTPX](./guides/requests-and-httpx)
- [Beautiful Soup](./guides/beautiful-soup)
- [Playwright](./guides/playwright)
- [Selenium](./guides/selenium)
- [Scrapy](./guides/scrapy)
- [Running webserver](./guides/running-webserver)
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def main():
### Using proxies with requests

To use Apify Proxy with `requests`,
you can just generate a proxy URL through [`Actor.create_proxy_configuration()`](../../reference/class/Actor#create_proxy_configuration),
you can just generate a proxy URL through [`Actor.create_proxy_configuration()`](../../../reference/class/Actor#create_proxy_configuration),
and pass it to `requests` using the [`proxies` argument](https://requests.readthedocs.io/en/latest/user/advanced/#proxies):

```python title="src/main.py"
Expand Down Expand Up @@ -85,7 +85,7 @@ async def main():
### Using proxies with HTTPX

To use Apify Proxy with `httpx`,
you can just generate a proxy URL through [`Actor.create_proxy_configuration()`](../../reference/class/Actor#create_proxy_configuration),
you can just generate a proxy URL through [`Actor.create_proxy_configuration()`](../../../reference/class/Actor#create_proxy_configuration),
and pass it to `httpx` using the [`proxies` argument](https://requests.readthedocs.io/en/latest/user/advanced/#proxies):

```python title="src/main.py"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ The Apify SDK provides several options on how to manage this.

#### `Actor.init()` and `Actor.exit()`

The [`Actor.init()`](../../reference/class/Actor#init) method initializes the Actor,
The [`Actor.init()`](../../../reference/class/Actor#init) method initializes the Actor,
the event manager which processes the Actor events from the platform event websocket,
and the storage client used in the execution environment.
It should be called before performing any other Actor operations.

The [`Actor.exit()`](../../reference/class/Actor#exit) method then exits the Actor cleanly,
The [`Actor.exit()`](../../../reference/class/Actor#exit) method then exits the Actor cleanly,
tearing down the event manager and the storage client.
There is also the [`Actor.fail()`](../../reference/class/Actor#fail) method, which exits the Actor while marking it as failed.
There is also the [`Actor.fail()`](../../../reference/class/Actor#fail) method, which exits the Actor while marking it as failed.

```python title="src/main.py"
from apify import Actor
Expand All @@ -40,10 +40,10 @@ async def main():

#### Context manager

So that you don't have to call the lifecycle methods manually, the [`Actor`](../../reference/class/Actor) class provides a context manager,
which calls the [`Actor.init()`](../../reference/class/Actor#init) method on enter,
the [`Actor.exit()`](../../reference/class/Actor#exit) method on a clean exit,
and the [`Actor.fail()`](../../reference/class/Actor#fail) method when there is an exception during the run of the Actor.
So that you don't have to call the lifecycle methods manually, the [`Actor`](../../../reference/class/Actor) class provides a context manager,
which calls the [`Actor.init()`](../../../reference/class/Actor#init) method on enter,
the [`Actor.exit()`](../../../reference/class/Actor#exit) method on a clean exit,
and the [`Actor.fail()`](../../../reference/class/Actor#fail) method when there is an exception during the run of the Actor.

This is the recommended way to work with the `Actor` class.

Expand All @@ -59,7 +59,7 @@ async def main():

#### Main function

Another option is to pass a function to the Actor via the [`Actor.main(main_func)`](../../reference/class/Actor#main) method,
Another option is to pass a function to the Actor via the [`Actor.main(main_func)`](../../../reference/class/Actor#main) method,
which causes the Actor to initialize, run the main function, and exit, catching any runtime errors in the passed function.

```python title="src/main.py"
Expand All @@ -77,7 +77,7 @@ async def main():
### Rebooting an Actor

Sometimes, you want to restart your Actor to make it run from the beginning again.
To do that, you can use the [`Actor.reboot()`](../../reference/class/Actor#reboot) method.
To do that, you can use the [`Actor.reboot()`](../../../reference/class/Actor#reboot) method.
When you call it, the Apify platform stops the container of the run,
and starts a new container of the same Actor with the same run ID and storages.

Expand All @@ -98,7 +98,7 @@ To inform you or the users running your Actors about the progress of their runs,
you can set the status message for the run, which will then be visible in the run detail in Apify Console,
or accessible through the Apify API.

To set the status message for the Actor run, you can use the [`Actor.set_status_message()`](../../reference/class/Actor#set_status_message) method.
To set the status message for the Actor run, you can use the [`Actor.set_status_message()`](../../../reference/class/Actor#set_status_message) method.

```python title="src/main.py"
from apify import Actor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ sidebar_label: Actor input
The Actor gets its [input](https://docs.apify.com/platform/actors/running/input) from the input record in its default key-value store.

To access it, instead of reading the record manually,
you can use the [`Actor.get_input()`](../../reference/class/Actor#get_input) convenience method.
you can use the [`Actor.get_input()`](../../../reference/class/Actor#get_input) convenience method.
It will get the input record key from the Actor configuration,
read the record from the default key-value store,
and decrypt any [secret input fields](https://docs.apify.com/platform/actors/development/secret-input).
Expand Down
Loading