Mikhail Sisin Co-founder of cloud-based web scraping and data extraction platform Diggernaut. Over 10 years of experience in data extraction, ETL, AI, and ML.

Product and price scraper for Alexander McQueen online store

5 min read

Product and price scraper for Alexander McQueen online store

Alexander McQueen – was a famous British fashion designer and founded his own label and fashion house. This product and price scraper is designed to extract information about merchanise sold at the flagship online store of the fashion house alexandermcqueen.com.

Approx number of goods: 1000
Approx number of page requests: 2300
Recommended subscription plan: Free

PLEASE NOTE! The number of requests can exceed the number of products, because data about variations, images, etc. can be scraped from other resources and will require additional requests. Also part of the product data can be delivered using XHR requests, which also increases the total number of required page requests.

How to use the web scraper to extract data about products and prices from alexandermcqueen.com

To use the web scraper for Alexander McQueen store’s website, you must have an account with our Diggernaut service. You can just simply follow this comprehensive guide:

  1. Go through this registration link to open free account with Diggernaut
  2. After registering and confirming the email address, you will need to log in to your account
  3. Create a project with any name and description, if you do not know how to do it, please refer to our documentation
  4. Switch to the created project and create a digger with any name, if you do not know how to do it, please refer to our documentation
  5. Copy the following digger configuration to the clipboard and paste it into the digger you created, if you do not know how to do it, refer to our documentation
  6. Switch the mode of the digger from Debug to Active, if you do not know how to do it, please refer to our documentation
  7. Run your digger and wait until the completion, if you do not know how to do it, please refer to our documentation
  8. Download the scraped dataset in the format you need, if you do not know how to do it, please refer to our documentation

You can also setup a schedule for running your scraper and collect data regularly.

Scraping configuration for the digger

---
config:
    debug: 2
    agent: Firefox
do:
- walk:
    to: http://www.alexandermcqueen.com/us/
    do:
    - find:
        path: ul.level-1>li
        do:
        - variable_clear: cat1
        - parse:
            attr: id
        - normalize:
            routine: replace_matched
            args:
                shop_womenswear: Womens
                shop_menswear: Mens
                .+: ''
        - variable_set: cat1
        - find:
            path: ul.level-2>li
            do:
            - variable_clear: cat2
            - find:
                path: a
                slice: 0
                do:
                - parse
                - space_dedupe
                - trim
                - variable_set: cat2
            - find:
                path: ul.level-3>li
                do:
                - variable_clear: cat3
                - find:
                    path: a
                    slice: 0
                    do:
                    - parse
                    - space_dedupe
                    - trim
                    - variable_set: cat3
                    - parse:
                        attr: href
                    - space_dedupe
                    - trim
                    - if:
                        match: \w+
                        do:
                        - normalize:
                            routine: url
                        - walk:
                            to: value
                            do:
                            - find:
                                path: script:contains('yTos.navigation =')
                                do:
                                - parse:
                                    filter: yTos\.navigation\s+\=\s+(.+)\;
                                - normalize:
                                    routine: json2xml
                                - to_block
                                - find:
                                    path: pathandqueryparsed:has(paramname:matches(^sitecode$))
                                    do:
                                    - find:
                                        path: paramvalue
                                        do:
                                        - parse
                                        - variable_set: sitecode
                                - find:
                                    path: pathandqueryparsed:has(paramname:matches(^dept$))
                                    do:
                                    - find:
                                        path: paramvalue
                                        do:
                                        - parse
                                        - variable_set: department
                                - find:
                                    path: pathandqueryparsed:has(paramname:matches(^season$))
                                    do:
                                    - find:
                                        path: paramvalue
                                        do:
                                        - parse
                                        - normalize:
                                            routine: replace_substring
                                            args:
                                                \,: "%2C"
                                        - variable_set: season
                                - find:
                                    path: pathandqueryparsed:has(paramname:matches(^gender$))
                                    do:
                                    - find:
                                        path: paramvalue
                                        do:
                                        - parse
                                        - variable_set: gender
                                - find:
                                    path: pathandqueryparsed:has(paramname:matches(^yurirulename$))
                                    do:
                                    - find:
                                        path: paramvalue
                                        do:
                                        - parse
                                        - variable_set: yurirulename
                                - walk:
                                    to: http://www.alexandermcqueen.com/Search/RenderProducts?ytosQuery=true&department=<%department%>&gender=<%gender%>&season=<%season%>&yurirulename=<%yurirulename%>&page=1&productsPerPage=1000&suggestion=false&totalPages=1&partialLoadedItems=1000&siteCode=<%sitecode%>
                                    do:
                                    - find:
                                        path: article>a
                                        do:
                                        - parse:
                                            attr: href
                                            filter: ^([^\#]+)
                                        - walk:
                                            to: value
                                            do:
                                            - sleep: 2
                                            - find:
                                                path: article.item
                                                do:
                                                - variable_clear: pid
                                                - variable_clear: cid
                                                - object_new: product
                                                - eval:
                                                    routine: js
                                                    body: '(function (){var d = new Date(); return d.toISOString()})();'
                                                - object_field_set:
                                                    object: product
                                                    field: date
                                                - static_get: url
                                                - object_field_set:
                                                    object: product
                                                    field: url
                                                - register_set: Alexander McQueen
                                                - object_field_set:
                                                    object: product
                                                    field: brand
                                                - find:
                                                    path: h2.modelName
                                                    do:
                                                    - parse
                                                    - space_dedupe
                                                    - trim
                                                    - object_field_set:
                                                        object: product
                                                        field: name
                                                - find:
                                                    in: doc
                                                    path: meta[name="description"]
                                                    do:
                                                    - parse:
                                                        attr: content
                                                    - space_dedupe
                                                    - trim
                                                    - variable_set: desc
                                                - find:
                                                    path: div.descriptionsContainer>div.EditorialDescription
                                                    do:
                                                    - parse
                                                    - space_dedupe
                                                    - trim
                                                    - variable_set: desc
                                                - variable_get: desc
                                                - object_field_set:
                                                    object: product
                                                    field: description
                                                - find:
                                                    path: div.itemPriceContainer span.price
                                                    slice: 0
                                                    do:
                                                    - find:
                                                        path: span.currency
                                                        do:
                                                        - parse
                                                        - normalize:
                                                            routine: replace_matched
                                                            args:
                                                                \$: USD
                                                        - object_field_set:
                                                            object: product
                                                            field: currency
                                                    - find:
                                                        path: span.value
                                                        do:
                                                        - parse
                                                        - normalize:
                                                            routine: replace_substring
                                                            args:
                                                            - \,: ''
                                                            - \s+: ''
                                                        - object_field_set:
                                                            object: product
                                                            type: float
                                                            field: price
                                                - find:
                                                    path: div.modelFabricColor>span.value
                                                    do:
                                                    - parse
                                                    - space_dedupe
                                                    - trim
                                                    - if:
                                                        match: \w+
                                                        do:
                                                        - variable_set: pid
                                                        - object_field_set:
                                                            object: product
                                                            field: sku
                                                - variable_get: cat1
                                                - if:
                                                    match: \w{2,}
                                                    do:
                                                    - object_field_set:
                                                        object: product
                                                        joinby: "|"
                                                        field: category
                                                - variable_get: cat2
                                                - if:
                                                    match: \w{2,}
                                                    do:
                                                    - object_field_set:
                                                        object: product
                                                        joinby: "|"
                                                        field: category
                                                - variable_get: cat3
                                                - if:
                                                    match: \w{2,}
                                                    do:
                                                    - object_field_set:
                                                        object: product
                                                        joinby: "|"
                                                        field: category
                                                - find:
                                                    path: ul.alternativeImages>li>img
                                                    do:
                                                    - parse:
                                                        attr: srcset
                                                    - to_block
                                                    - split:
                                                        context: text
                                                        delimiter: \,\s*
                                                    - find:
                                                        path: div.splitted
                                                        slice: 0
                                                        do:
                                                        - parse:
                                                            filter: ^([^\s]+)
                                                        - object_field_set:
                                                            object: product
                                                            joinby: "|"
                                                            field: images
                                                - find:
                                                    path: div.selectColor
                                                    slice: 0
                                                    do:
                                                    - variable_clear: cod10
                                                    - find:
                                                        in: doc
                                                        path: script:contains("yTos.navigation.itemData =")
                                                        do:
                                                        - parse:
                                                            filter: yTos\.navigation\.itemData\s+\=\s+(.+)\;
                                                        - normalize:
                                                            routine: json2xml
                                                        - to_block
                                                        - find:
                                                            path: cod10
                                                            do:
                                                            - parse
                                                            - space_dedupe
                                                            - trim
                                                            - variable_set: cod10
                                                            - walk:
                                                                to: http://www.alexandermcqueen.com/yTos/api/Plugins/ItemPluginApi/GetCombinationsAsync/?siteCode=<%sitecode%>&code10=<%cod10%>
                                                                do:
                                                                - find:
                                                                    path: body_safe>colors
                                                                    do:
                                                                    - find:
                                                                        path: description
                                                                        do:
                                                                        - parse
                                                                        - space_dedupe
                                                                        - trim
                                                                        - if:
                                                                            match: \w+
                                                                            do:
                                                                            - object_field_set:
                                                                                object: product
                                                                                joinby: "|"
                                                                                field: variations
                                                - object_save:
                                                    name: product

Sample of scraped data

Below is a sample of a dataset with several products in JSON format (so you can easily review it and see data structure). The dataset can be downloaded as CSV, XLSX, XML, or any other text format using the templates.

[{
    "product": {
        "brand": "Alexander McQueen",
        "category": "Shop by|Sale",
        "currency": "USD",
        "date": "2017-12-05T17:25:41.800Z",
        "description": "Sleeveless black leather midi-length dress, in raw cut panels whip-stitched together. Featuring hand-applied, silver-plated metal eyelets, which are hand-laced with multicolored leather laces, left long as decorative fringe.",
        "images": "https://cdn.yoox.biz/items/34/34767065be_18_g_f.jpg|https://cdn.yoox.biz/items/34/34767065be_18_g_r.jpg|https://cdn.yoox.biz/items/34/34767065be_18_g_d.jpg|https://cdn.yoox.biz/items/34/34767065be_18_g_e.jpg|https://cdn.yoox.biz/items/34/34767065be_18_g_a.jpg",
        "name": "Whip-Stitched Leather Dress",
        "price": 5699,
        "sku": "493349Q5HLU1666",
        "url": "http://www.alexandermcqueen.com/us/alexandermcqueen/long-dress_cod34767065be.html",
        "variations": "BLACK"
    }
}
,{
    "product": {
        "brand": "Alexander McQueen",
        "category": "Shop by|Sale",
        "currency": "USD",
        "date": "2017-12-05T17:25:45.343Z",
        "description": "Long-sleeved, crew neck BouclГ© knit dress with multicolored leather laces, laced through hand-applied silver-plated metal eyelets.",
        "images": "https://cdn.yoox.biz/items/34/34767074av_18_g_f.jpg|https://cdn.yoox.biz/items/34/34767074av_18_g_r.jpg|https://cdn.yoox.biz/items/34/34767074av_18_g_d.jpg|https://cdn.yoox.biz/items/34/34767074av_18_g_e.jpg|https://cdn.yoox.biz/items/34/34767074av_18_g_a.jpg",
        "name": "BouclГ© Knit Long Dress with Leather Lacing",
        "price": 3179,
        "sku": "493382Q1WHI1666",
        "url": "http://www.alexandermcqueen.com/us/alexandermcqueen/long-dress_cod34767074av.html",
        "variations": "BLACK"
    }
}
,{
    "product": {
        "brand": "Alexander McQueen",
        "category": "Shop by|Sale",
        "currency": "USD",
        "date": "2017-12-05T17:25:48.261Z",
        "description": "Long ivory plissГ© knit dress with extra fine merino wool piping in red, finished with a decorative lurex cross stitch that is left long as frayed fringe on hem and shoulders. Roll neck and invisible zipper on center back.",
        "images": "https://cdn.yoox.biz/items/34/34767073al_18_g_f.jpg|https://cdn.yoox.biz/items/34/34767073al_18_g_r.jpg|https://cdn.yoox.biz/items/34/34767073al_18_g_d.jpg|https://cdn.yoox.biz/items/34/34767073al_18_g_e.jpg|https://cdn.yoox.biz/items/34/34767073al_18_g_a.jpg",
        "name": "Long Knit Dress With Roll Neck",
        "price": 2444,
        "sku": "493374Q1WHC9082",
        "url": "http://www.alexandermcqueen.com/us/alexandermcqueen/long-dress_cod34767073al.html",
        "variations": "IVORY/RED"
    }
}
,{
    "product": {
        "brand": "Alexander McQueen",
        "category": "Shop by|Sale",
        "currency": "USD",
        "date": "2017-12-05T17:25:51.193Z",
        "description": "Long black plissГ© knit dress with extra fine merino wool piping in red, finished with a decorative lurex cross stitch that is left long as frayed fringe. Featuring a roll neck and long voluminous balloon sleeves with an invisible zipper on center back.",
        "images": "https://cdn.yoox.biz/items/34/34767069qs_18_g_f.jpg|https://cdn.yoox.biz/items/34/34767069qs_18_g_r.jpg|https://cdn.yoox.biz/items/34/34767069qs_18_g_d.jpg|https://cdn.yoox.biz/items/34/34767069qs_18_g_e.jpg|https://cdn.yoox.biz/items/34/34767069qs_18_g_a.jpg",
        "name": "Long-Sleeved Knit Dress With Roll Neck",
        "price": 2669,
        "sku": "493373Q1WHB1056",
        "url": "http://www.alexandermcqueen.com/us/alexandermcqueen/long-dress_cod34767069qs.html",
        "variations": "BLACK/RED"
    }
}]
Mikhail Sisin Co-founder of cloud-based web scraping and data extraction platform Diggernaut. Over 10 years of experience in data extraction, ETL, AI, and ML.

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.