Actor picture

Forever21 Scraper

emastra/forever21-scraper

Forever21 Scraper is an Apify actor for extracting product data from forever21.com fashion on line store. It allows you to scrape the whole site, specific categories and products.

No credit card required

Author's avatarEmiliano Mastragostino
  • Modified
  • Users34
  • Runs394

To run the code examples, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token. For a more detailed explanation, please read about running actors via the API in Apify Docs.

const { ApifyClient } = require('apify-client');

// Initialize the ApifyClient with API token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare actor input
const input = {
    "startUrls": [
        {
            "url": "https://www.forever21.com"
        }
    ],
    "maxItems": 0,
    "extendOutputFunction": ($) => {
        const result = {};
        // Uncomment to modify the title of each item of the output
        // result.title = 'Test Title';
    
        return result;
    },
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

(async () => {
    // Run the actor and wait for it to finish
    const run = await client.actor("emastra/forever21-scraper").call(input);

    // Fetch and print actor results from the run's dataset (if any)
    console.log('Results from dataset');
    const { items } = await client.dataset(run.defaultDatasetId).listItems();
    items.forEach((item) => {
        console.dir(item);
    });
})();