+ Reply to Thread
Results 1 to 7 of 7

Extract Specific Data From URLs

  1. #1
    Registered User
    Join Date
    01-07-2016
    Location
    FL, USA
    MS-Off Ver
    2007
    Posts
    22

    Question Extract Specific Data From URLs

    Hi all,

    I'm interested in knowing if there's functions where you can extract specific data (item number information that may be numeric or alphanumeric) from URLs. The URL structure differs from one retailer to another so I'd be okay if individual functions are custom tailored for specific retailers (can be easily sorted out).

    Here's a visual representation of what I'd like to accomplish:

    For Wayfair:

    1st type of URL:
    Data: http://www.wayfair.com/12-Cup-Brewst...0-HMB1637.html
    Output: HMB1637

    2nd type of URL:
    Data: http://www.wayfair.com/4.0-Cu.-Ft.-C...1466.html?PiID[]=14213412
    Output: HER1466

    * In both cases, extracted content appears after the last hypen (-) and before the '.html' and can vary in length depending on the item #
    If the same function can be used for both types of URL, that'd be awesome


    For Costco

    Data: http://www.costco.com/Outland-24%22-...100222806.html
    Output: 100222806

    * the extracted content appears after the 2nd to last period (.) and before the '.html' and can vary in length depending on the item #


    For Overstock:

    Data: http://www.overstock.com/Bedding-Bat...7/product.html
    Output: 7440617

    * extracted content appears after the last 2nd to last forward slash (/) and before the last forward slash (/) and can vary in length depending on the item #


    For Mill's Fleet Farm

    Data: http://www.farmandfleet.com/products...ol-holder.html
    Output: 581151

    *extracted content appears after the last forward slash (/) and before the hypen (-)


    For Sam's Club

    Data: http://www.samsclub.com/sams/7-5ft-h...rod18310195.ip
    Output: 18310195

    * extracted content appears after the last forward slash (/), does NOT include 'prod' and before the '.ip'

    Thanks

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,810

    Re: Extract Specific Data From URLs

    You can see that the forum software has truncated those URLs, and so it is difficult to see the data that you want to extract in some cases. It might be easier to see if you put some URLs in an Excel file in one column and in another column tell us what you would want to extract from the URL. The FAQ describes how to attach a file to one of your posts (basically, click Go Advanced, then scroll down to Manage Attachments, then follow the on-screen prompts).

    Pete

  3. #3
    Registered User
    Join Date
    01-07-2016
    Location
    FL, USA
    MS-Off Ver
    2007
    Posts
    22

    Re: Extract Specific Data From URLs

    Great idea Pete. How's this?
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    01-07-2016
    Location
    FL, USA
    MS-Off Ver
    2007
    Posts
    22

    Re: Extract Specific Data From URLs

    And actual file attached if it makes it easier
    Attached Files Attached Files

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extract Specific Data From URLs

    There is not much of consistency in this data-set so it may not be perfect.

    try this array formula in B2 and copy down

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ***Array formula must be entered by using key combination of CTRL+SHIFT+ENTER and not just ENTER


    A
    B
    1
    Data
    2
    http://www.wayfair.com/12-Cup-Brewstation-Coffee-Maker-47900-HMB1637.html HMB1637
    3
    http://www.wayfair.com/4.0-Cu.-Ft.-Compact-Refrigerator-with-freezer-HC40SG42S-HER1466.html?PiID HER1466
    4
    5
    http://www.costco.com/Outland-24%22-Portable-Propane-Fire-Bowl-Mega.product.100222806.html 100222806
    6
    7
    http://www.overstock.com/Bedding-Bath/Super-Size-PrimaLoft-400-Thread-Count-Supima-Down-Alternative-Comforter/7440617/product.html 7440617
    8
    9
    http://www.farmandfleet.com/products/581151-rubbermaid-fasttrack-power-tool-holder.html 581151
    10
    11
    http://www.samsclub.com/sams/7-5ft-hallmark-sugar-dotcom-2015/prod18310195.ip 18310195
    Sheet: Sheet1
    Last edited by AlKey; 01-07-2016 at 08:52 PM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Registered User
    Join Date
    01-07-2016
    Location
    FL, USA
    MS-Off Ver
    2007
    Posts
    22

    Re: Extract Specific Data From URLs

    Alkey, thanks for your response, much appreciated.

    I knew there wasn't consistency from one supplier URL to another, that's why I separated them out. Possible to build functions for each set of suppliers listed above so that I do get perfect results? (a bit more work I understand but I'd be deeply appreciative).

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2404
    Posts
    13,407

    Re: Extract Specific Data From URLs

    censo,

    @ how many unique supplier URLs are there?

    Perhaps something like this? Line breaks at each choice.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    With a lookup table in Y1:Z5 this helper column formula would go in O2 and filled down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    It's only function is to assign the first argument to the CHOOSE formula above.

    It could probably be trimmed down somewhat.
    Attached Files Attached Files
    Last edited by FlameRetired; 01-08-2016 at 12:57 AM.
    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Extract xml elements from mutiple urls into Excel
    By superdesi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-17-2015, 01:42 PM
  2. Replies: 4
    Last Post: 07-28-2014, 05:37 PM
  3. module for extract data from multiple URLs
    By latifpatel.t in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2013, 10:08 AM
  4. Macro to extract data from multiple workbooks, specific sheet, specific cells
    By crissandraauree in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-29-2012, 03:54 PM
  5. Loop thru URLs to extract web data
    By trwlch in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-20-2012, 04:26 AM
  6. [SOLVED] extract urls from hyperlinked images
    By simarui in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-18-2012, 04:11 PM
  7. Find and Extract URLs with certain parameters
    By superblogger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2011, 06:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1