Integration with general Node.js spider

Add the following code to the results save section of your spider.

// Import SDK
const crawlab = require('crawlab-sdk');

// This is a result. It needs to be object type
const result = {name: 'crawlab'};

(async () => {
    // Call save result method
    await crawlab.saveItem(result);

    // Close the database connection, otherwise the program will not end
    await crawlab.close();
})();

Then start the spider. After running, you should be able to see the result in task details - result.

© 2020 Crawlab, Made by Crawlab-Team all right reserved,powered by Gitbook该文件最后修改时间: 2020-10-05 06:00:14

results matching ""

    No results matching ""

    results matching ""

      No results matching ""