Skip to content

Commit 632a585

Browse files
committed
docs: Apply review suggestions to the guides
1 parent e9011da commit 632a585

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

docs/03_guides/01_beautifulsoup_httpx.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To create an Actor which uses those libraries, start from the [BeautifulSoup & P
2020

2121
## Example Actor
2222

23-
Below is a simple Actor that recursively scrapes data from linked pages on the same site, up to a specified maximum depth, starting from URLs provided in the Actor input. It uses [HTTPX](https://www.python-httpx.org/) for fetching pages through [Apify Proxy](https://docs.apify.com/platform/proxy) and [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) for parsing their content to extract the title, headings, and links to other pages.
23+
The following example is a simple Actor that recursively scrapes data from linked pages on the same site, up to a specified maximum depth, starting from URLs provided in the Actor input. It uses [HTTPX](https://www.python-httpx.org/) for fetching pages through [Apify Proxy](https://docs.apify.com/platform/proxy) and [BeautifulSoup](https://www.crummy.com/software/BeautifulSoup/) for parsing their content to extract the title, headings, and links to other pages.
2424

2525
<RunnableCodeBlock className="language-python" language="python">
2626
{BeautifulSoupHttpxExample}

docs/03_guides/04_selenium.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ It uses Selenium ChromeDriver to open the pages in an automated Chrome browser,
4444

4545
Running on the Apify platform gives your scraper access to [Apify Proxy](https://docs.apify.com/platform/proxy), which rotates IP addresses to avoid rate limiting and blocking. The example creates a proxy configuration with `Actor.create_proxy_configuration` and routes the browser through it for the whole run.
4646

47-
Chrome ignores the credentials passed in the `--proxy-server` flag. An authenticated proxy such as Apify Proxy therefore has to be configured from inside a small extension. The `proxy_auth_extension` helper builds one at runtime: its service worker sets the proxy server and answers the browser's authentication challenge with the username and password. Note that the new headless mode (`--headless=new`) is required for Chrome to load the extension. To select specific proxy groups or a country, pass the relevant arguments to `Actor.create_proxy_configuration`. For details, see [Proxy management](../concepts/proxy-management).
47+
Chrome ignores the credentials passed in the `--proxy-server` flag. Because of that, configure an authenticated proxy such as Apify Proxy from inside a small extension. The `proxy_auth_extension` helper builds one at runtime: its service worker sets the proxy server and answers the browser's authentication challenge with the username and password. Note that the new headless mode (`--headless=new`) is required for Chrome to load the extension. To select specific proxy groups or a country, pass the relevant arguments to `Actor.create_proxy_configuration`. For details, see [Proxy management](../concepts/proxy-management).
4848

4949
## Conclusion
5050

docs/03_guides/06_scrapy.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ In this guide, you'll learn how to build web crawlers with the [Scrapy](https://
2323

2424
## Integrating Scrapy with the Apify platform
2525

26-
The Apify SDK provides an Apify-Scrapy integration. The main challenge of this is to combine two asynchronous frameworks that use different event loop implementations. Scrapy uses [Twisted](https://twisted.org/) for asynchronous execution, while the Apify SDK is based on [asyncio](https://docs.python.org/3/library/asyncio.html). The key thing is to install Twisted's `asyncioreactor` to run Twisted's asyncio compatible event loop. The `apify.scrapy.run_scrapy_actor` function handles this reactor installation automatically. This allows both Twisted and asyncio to run on a single event loop, enabling a Scrapy spider to run as an Apify Actor with minimal modifications.
26+
The Apify SDK provides an Apify-Scrapy integration. The main challenge is to combine two asynchronous frameworks that use different event loop implementations. Scrapy uses [Twisted](https://twisted.org/) for asynchronous execution, while the Apify SDK is based on [asyncio](https://docs.python.org/3/library/asyncio.html). The key thing is to install Twisted's `asyncioreactor` to run Twisted's asyncio compatible event loop. The `apify.scrapy.run_scrapy_actor` function handles this reactor installation automatically. This allows both Twisted and asyncio to run on a single event loop, enabling a Scrapy spider to run as an Apify Actor with minimal modifications.
2727

2828
<CodeBlock className="language-python" title="__main__.py: The Actor entry point">
2929
{UnderscoreMainExample}

docs/03_guides/12_running_webserver.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Each Actor run on the Apify platform is assigned a unique hard-to-guess URL (for
1818
The URL is available in the following places:
1919

2020
- In [Apify Console](https://docs.apify.com/platform/console), on the Actor run details page as the **Container URL** field.
21-
- In the API as the `container_url` property of the [Run object](https://docs.apify.com/api/v2#/reference/actors/run-object/get-run).
21+
- In the API as the `containerUrl` property of the [Run object](https://docs.apify.com/api/v2/actor-run-get).
2222
- In the Actor as the `Actor.configuration.web_server_url` property.
2323

2424
The web server running inside the container must listen at the port defined by the `Actor.configuration.web_server_port` property. When running Actors locally, the port defaults to `4321`, so the web server will be accessible at `http://localhost:4321`.
@@ -33,7 +33,7 @@ The following example shows how to start a simple web server in your Actor, whic
3333

3434
## Using FastAPI
3535

36-
The example above relies only on Python's standard library, which keeps it dependency-free but leaves you handling requests by hand. For anything beyond a single endpoint, a web framework such as [FastAPI](https://fastapi.tiangolo.com/) is a better fit. It gives you routing, request parsing, and automatic JSON responses, and is served by an ASGI server like [uvicorn](https://www.uvicorn.org/).
36+
The example relies only on Python's standard library, which keeps it dependency-free but leaves you handling requests by hand. For anything beyond a single endpoint, a web framework such as [FastAPI](https://fastapi.tiangolo.com/) is a better fit. It gives you routing, request parsing, and automatic JSON responses, and is served by an ASGI server like [uvicorn](https://www.uvicorn.org/).
3737

3838
Install both, for example by adding them to your `requirements.txt`:
3939

@@ -56,7 +56,7 @@ Note that:
5656

5757
## Actor Standby
5858

59-
The example above runs a web server for the duration of a single Actor run. With [Actor Standby](https://docs.apify.com/platform/actors/development/programming-interface/standby), you can instead expose your Actor as an always-ready HTTP API: the platform keeps the Actor running in the background and routes incoming HTTP requests to the web server inside it, spinning up additional instances as the load grows.
59+
The example runs a web server for the duration of a single Actor run. With [Actor Standby](https://docs.apify.com/platform/actors/development/programming-interface/standby), you can instead expose your Actor as an always-ready HTTP API: the platform keeps the Actor running in the background and routes incoming HTTP requests to the web server inside it, spinning up additional instances as the load grows.
6060

6161
From the SDK's perspective, a Standby Actor is built the same way as the web server above. You start an HTTP server listening on the port from `Actor.configuration.web_server_port`. The difference is operational: instead of doing its work once and exiting, a Standby Actor stays up and serves requests. This makes it a good fit for low-latency, on-demand use cases, such as serving scraped data or acting as a microservice.
6262

docs/03_guides/code/03_playwright.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from apify.storages import RequestQueue
99

1010
# To run locally, install the browsers first: `playwright install --with-deps`.
11-
# On the Apify platform they are already in the Actor's Docker image.
11+
# On the Apify platform, browsers are already in the Actor's Docker image.
1212

1313

1414
def to_playwright_proxy(proxy_url: str) -> dict[str, str]:

docs/03_guides/code/04_selenium.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
# To run locally, install the Selenium Chromedriver:
1717
# https://www.selenium.dev/documentation/webdriver/getting_started/install_drivers/
18-
# On the Apify platform it is already in the Actor's Docker image.
18+
# On the Apify platform, it's already in the Actor's Docker image.
1919

2020

2121
def proxy_auth_extension(proxy_url: str) -> str:

0 commit comments

Comments
 (0)