Rust Scraper
Try for free
No credit card required
View all Actors
Rust Scraper
lukaskrivka/rust-scraper
Try for free
No credit card required
Speed of light scraping with Rust programming language! This is an early alpha version for experimenting, use at your own risk!
The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more
Node.js
Python
curl
1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4const client = new ApifyClient({
5 token: '<YOUR_API_TOKEN>',
6});
7
8// Prepare Actor input
9const input = {
10 "urls": [
11 {
12 "url": "http://example.com"
13 }
14 ],
15 "extract": [
16 {
17 "field_name": "title",
18 "selector": "h1",
19 "extract_type": {
20 "type": "Text"
21 }
22 },
23 {
24 "field_name": "description",
25 "selector": "p",
26 "extract_type": {
27 "type": "Text"
28 }
29 }
30 ],
31 "proxy_settings": {
32 "useApifyProxy": true
33 }
34};
35
36(async () => {
37 // Run the Actor and wait for it to finish
38 const run = await client.actor("lukaskrivka/rust-scraper").call(input);
39
40 // Fetch and print Actor results from the run's dataset (if any)
41 console.log('Results from dataset');
42 console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43 const { items } = await client.dataset(run.defaultDatasetId).listItems();
44 items.forEach((item) => {
45 console.dir(item);
46 });
47})();
48
49// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Developer
Maintained by Community
Actor metrics
- 2 monthly users
- 100.0% runs succeeded
- 0.0 days response time
- Created in Feb 2019
- Modified about 3 years ago
Categories