+ Reply to Thread
Results 1 to 9 of 9

Thread: Extract Data from a URL stored in a Cell

  1. #1
    Registered User
    Join Date
    06-30-2011
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Extract Data from a URL stored in a Cell

    Hey
    I've had a read through other posts relating to dynamic web queries but they couldn't help me.

    I have an excel spreadsheet containing a list of URLs in column C and I am trying to extract the data within the following tags:
    <table cellpadding="0" cellspacing="0" border="0" align="center" width="580" id="header">
    <tr style="background: #003467 url(/lectopia_data/delivery/templateimages/header-1.gif) top left no-repeat;" height="66">
    <td align="right"><div style="width:50%"><h2 style="color: #FFFFFF;">internet demo (00020)</h2></div>
    </tr>
    </table>
    so that the text "internet demo (00020)" is saved into the adjacent cell in column D.

    Could anybody please help create a dynamic query to achieve this? or am i going about this the wrong way by using excel?
    Thanks
    Frank
    Last edited by frankfrankleton; 07-01-2011 at 09:16 AM.

  2. #2
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,228

    Re: Extract Data from a URL stored in a Cell

    That doesn't look like a URL to me, more like some HTML code.

    Is all of that in one cell? Or are the lines of HTML in separate cells? Is the information you want always after an H2 level heading?

    A sample workbook with some typical data might help advance your cause here.

    Regards

  3. #3
    Registered User
    Join Date
    06-30-2011
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Extract Data from a URL stored in a Cell

    Sorry, should've explained my self better
    In Column C there is a list of URLs (EG: http://lectures.uni.edu.au/ilectures...res.lasso?ut=1)
    Which point to a page containing that as code as part of the source.
    The text "internet demo (00020)" changes on each of the URLs

    Frank

  4. #4
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,228

    Re: Extract Data from a URL stored in a Cell

    As I said,
    A sample workbook with some typical data might help advance your cause here
    Regards

  5. #5
    Registered User
    Join Date
    06-30-2011
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Extract Data from a URL stored in a Cell

    Sorry, missed that bit :p
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-30-2011
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Extract Data from a URL stored in a Cell

    and yes, the information is always after an H2 level heading

    Thanks
    Frank

  7. #7
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,228

    Re: Extract Data from a URL stored in a Cell

    I've put together a routine to get the source code and extract the header.

    However, I'm not 100% confident as the output varies. I'm guessing it's a timing problem and I've tried a few things to overcome it, the last being to navigate to the page twice.

    Anyway, have a look and see if it works any more consistently for you ... you'll see the various attempts.

    I'm probably missing something very basic but I just don't know what it is ;-(

    Regards
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-30-2011
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Extract Data from a URL stored in a Cell

    Thanks heaps!
    It's all working

  9. #9
    Forum Guru TMShucks's Avatar
    Join Date
    07-15-2010
    Location
    Manchester, England
    MS-Off Ver
    MSO 2003 & 2007
    Posts
    6,228

    Re: Extract Data from a URL stored in a Cell

    Excellent. I have to admit, I wasn't that confident but maybe it works better if you're local to the servers.

    Thanks for the rep.


    Regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0