Untitled 9
Pricing
Pay per usage
Go to Apify Store
Untitled 9
0.0 (0)
Pricing
Pay per usage
1
1
1
Last modified
7 years ago
Pricing
Pay per usage
0.0 (0)
Pricing
Pay per usage
1
1
1
Last modified
7 years ago
FROM apify/actor-node-basic# Copy source codeCOPY . ./#COPY src ./srcRUN npm --quiet set progress=false \&& npm install --only=prod --no-optional \&& echo "Installed NPM packages:" \&& npm list \&& echo "Node.js version:" \&& node --version \&& echo "NPM version:" \&& npm --version
1const Apify = require('apify');2const request = require('request-promise');3
4Apify.main(async () => {5 // Get input of your actor6 const input = await Apify.getValue('INPUT');7 console.log('My input:');8 console.dir(input);9
10 // Do something useful here11 const html = await request('http://www.example.com');12
13 // And then save output14 const output = {15 html,16 crawledAt: new Date(),17 };18 console.log('My output:');19 console.dir(output);20 await Apify.setValue('OUTPUT', output);21});
{ "name": "actors-name", "version": "0.0.1", "description": "Actors description", "main": "main.js", "dependencies": { "apify": "^0.11.5", "request-promise": "^4.2.2" }, "scripts": { "start": "node main.js" }, "author": "Actor creators name"}