Lazada Product Scraper
- sandboxcmd/lazada-scraper
- Modified
- Users 74
- Runs 628
- Created by
Deby C.
Lazada scraper to extract data from Lazada based on keywords and country. Scrape and download product information without using the Lazada API, including reviews, prices, descriptions. Download your data as HTML table, JSON, CSV, Excel, XML.
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.
import { ApifyClient } from 'apify-client';
// Initialize the ApifyClient with API token
const client = new ApifyClient({
token: '<YOUR_API_TOKEN>',
});
// Prepare Actor input
const input = {
"categoryUrls": [
{
"url": "https://www.lazada.co.id/gaun-wanita/?spm=a2o4j.home.categories.1.57997838Vw6eh0&up_id=2690052796&clickTrackInfo=378a8db0-4583-4567-ac9c-293c1b07eb2c__4962__2690052796__static__0.09986028971706916__158075__7253&from=hp_categories&item_id=2690052796&version=v2"
}
],
"proxyConfiguration": {
"useApifyProxy": true
}
};
(async () => {
// Run the Actor and wait for it to finish
const run = await client.actor("sandboxcmd/lazada-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);
});
})();