VOOZH about

URL: https://apify.com/lukaskrivka/rust-actor-example

⇱ Actor in Rust Example · Apify


Pricing

Pay per usage

Go to Apify Store

Actor in Rust Example

Example actor built in Rust programming language. Downloads HTML from any page. Works on Apify platform and locally.

Pricing

Pay per usage

Rating

0.0

(0)

Developer

👁 Lukáš Křivka

Lukáš Křivka

Maintained by Community

Actor stats

3

Bookmarked

14

Total users

0

Monthly active users

2 months ago

Last modified

Share

Example Apify actor in Rust

Minimal example for developing Apify actor in Rust programming language. The code is open source.

The example:

  • Reads user provided URL from input
  • Does HTTP request to get HTML from this URL
  • Saves HTML into OUTPUT record in Key Value Store

This actor works both on Apify platform and locally.

Local usage

For local usage, you need to:

  1. Clone the repository
  2. Install Rust
  3. Create local storage with apify init or manually create folder path apify_storage/key_value_stores/default/
  4. Add INPUT.json file input inside this path that looks like this:
{
"url":"https://apify.com"
}
  1. Build and run the solution with cargo run
  2. You can find OUTPUT.html next to INPUT.json

Current problems

  • Apify currently doesn't allow increasing memory for builds so they sometimes fails by running out of memory
  • Apify caches the Docker images on its servers. Rust is not yet used much there so a lot of runs have slow cold starts.

Where next?

If you want to see more complex scraping project in Rust, check Rust Scraper which is also open source

You might also like

Actor in Go example

jirimoravcik/go-actor-example

Example actor written in Go.

👁 User avatar

Jiří Moravčík

16

Rust Input Function Example

lukaskrivka/rust-input-function-example

Dynamically compile and run input-provided page function. Like Cheerio Scraper but in Rust.

👁 User avatar

Lukáš Křivka

5

Rust Scraper

lukaskrivka/rust-scraper

Speed of light scraping with Rust programming language! This is an early alpha version for experimenting, use at your own risk!

👁 User avatar

Lukáš Křivka

60

Actor in Julia example

jirimoravcik/julia-actor-example

Example actor written in Julia.

👁 User avatar

Jiří Moravčík

4

Ruby Example

drobnikj/ruby-example

Example of ruby code in actor

👁 User avatar

Jakub Drobník

14

Python Example

apify/python-example

Example Actor written in Python, showing how to read the Actor input and push to the Actor's default dataset.

Example Sitemap Cheerio

jancurn/example-sitemap-cheerio

An example actor that first downloads a sitemap in XML format and the crawls each page from the sitemap using the fast CheerioCrawler from Apify SDK.

41