Actor With Ui2
Try for free
No credit card required
Go to Store
Actor With Ui2
mtrunkat.com/actor-with-ui2
Try for free
No credit card required
You can access the Actor With Ui2 programmatically from your own JavaScript applications by using the Apify API. You can also choose the language preference from below. To use the Apify API, you’ll need an Apify account and your API token, found in Integrations settings in Apify Console.
1import { ApifyClient } from 'apify-client';
2
3// Initialize the ApifyClient with your Apify API token
4// Replace the '<YOUR_API_TOKEN>' with your token
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9// Prepare Actor input
10const input = {
11 "startUrls": [
12 {
13 "url": "http://example.com/prefil",
14 "method": "POST"
15 },
16 {
17 "url": "http://example.com/prefil2",
18 "method": "GET"
19 }
20 ],
21 "proxy": {
22 "useApifyProxy": true
23 },
24 "pageFunction": async () => {
25 return $('title prefill').text();
26
27 },
28 "textfieldProp": "blaah blaah prefill",
29 "textareaProp": `blaah
30 blaah
31 blaah prefill`,
32 "enumPropTitles": "fr",
33 "enumProp": "de",
34 "maxPagesPerCrawl": 3,
35 "pseudoUrls": [
36 {
37 "purl": "xxxxx"
38 },
39 {
40 "purl": "yyyyy"
41 }
42 ],
43 "jsonObj": {
44 "zzz": "zz"
45 }
46};
47
48// Run the Actor and wait for it to finish
49const run = await client.actor("mtrunkat.com/actor-with-ui2").call(input);
50
51// Fetch and print Actor results from the run's dataset (if any)
52console.log('Results from dataset');
53console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
54const { items } = await client.dataset(run.defaultDatasetId).listItems();
55items.forEach((item) => {
56 console.dir(item);
57});
58
59// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs
Actor With Ui2 API in JavaScript
The Apify API client for JavaScript is the official library that allows you to use Actor With Ui2 API in JavaScript or TypeScript, providing convenience functions and automatic retries on errors.
Install the apify-client
npm install apify-client
Other API clients include:
Developer
Maintained by Community
Actor Metrics
1 monthly user
-
1 star
>99% runs succeeded
Created in Sep 2018
Modified 6 years ago