Boulanger avatar
Boulanger
Deprecated
View all Actors
This Actor is deprecated

This Actor is unavailable because the developer has decided to deprecate it. Would you like to try a similar Actor instead?

See alternative Actors
Boulanger

Boulanger

anchor/boulanger

Extract information from boulanlger : simply provide your search URL (+ your filters and location). You will get the results easy, and fast

The code examples below show how to run the Actor and get its results. To run the code, you need to have an Apify account. Replace <YOUR_API_TOKEN> in the code with your API token, which you can find under Settings > Integrations in Apify Console. Learn more

1# Set API token
2API_TOKEN=<YOUR_API_TOKEN>
3
4# Prepare Actor input
5cat > input.json <<'EOF'
6{
7  "startUrls": [
8    {
9      "url": "https://www.boulanger.com/resultats?tr=samsung"
10    }
11  ],
12  "pageFunction": "async function pageFunction(context) {\n    let data = {}\n    let userData = context.request.userData\n    data.url = context.request.url\n    data.label = userData.label\n\n    let items = await context.page.evaluate(() => {\n        const item = $('.product-item')\n        // const item = $('.rm-product')\n        const itemInfo = item.map(function(i,elem) {\n            let obj = {}\n            obj.title = $(this).find('h2').text()\n            obj.sponsored = false\n            obj.price = $(this).find('.price__amount').text()\n            obj.img = $(this).find('img').attr('src')\n            obj.rank = i+1\n            return obj\n        }).get()\n\n        const itemSponsored = $('.rm-product')\n        const itemInfoSponsored = itemSponsored.map(function(i,elem) {\n            let obj = {}\n            obj.title = $(this).find('h2').text()\n            obj.sponsored = true\n            obj.price = $(this).find('.rm_price').text()\n            obj.img = $(this).find('img').attr('src')\n            obj.rank = i+1\n            return obj\n        }).get()\n\n        // return [...itemInfo,...itemInfoSponsored]\n        const allitems = itemInfoSponsored.concat(itemInfo)\n        return allitems\n    })\n    \n    let itemsWithDataProp = items.map(obj => { \n        for(const key of Object.keys(data) ){\n            obj[key] = data[key]\n        }\n        return obj\n    })\n    return itemsWithDataProp;\n}\n",
13  "proxyConfiguration": {
14    "useApifyProxy": true,
15    "apifyProxyGroups": [
16      "RESIDENTIAL"
17    ],
18    "apifyProxyCountry": "FR"
19  }
20}
21EOF
22
23# Run the Actor using an HTTP API
24# See the full API reference at https://docs.apify.com/api/v2
25curl "https://api.apify.com/v2/acts/anchor~boulanger/runs?token=$API_TOKEN" \
26  -X POST \
27  -d @input.json \
28  -H 'Content-Type: application/json'
Developer
Maintained by Community