+ Reply to Thread
Results 1 to 8 of 8

Getting info from a website using VBA

  1. #1
    Registered User
    Join Date
    07-12-2005
    Posts
    21

    Getting info from a website using VBA

    Hi wonder if someone can help me.
    I am using VBA to open an IE page and try to get some info however i cant seem to grab it

    This is the code i have..
    Please Login or Register  to view this content.
    I have inspected the code from the website and it is this

    Please Login or Register  to view this content.
    The problem is i dont know how to get the info in the "Metaname, ICBM"

    Any advice please

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Getting info from a website using VBA


    Hi,

    try with getElementsByName

    Any webpage link ?

  3. #3
    Registered User
    Join Date
    07-12-2005
    Posts
    21

    Re: Getting info from a website using VBA

    Hi Marc,

    Thanks for the response.
    Get Elementsbyname doesnt work either. I think the issue is that there are lots of fields called contents

    The website i am trying to get info from is..

    http://www.nearby.org.uk/coord.cgi?p...719.196&f=conv

    Cheers for your help

  4. #4
    Registered User
    Join Date
    07-12-2005
    Posts
    21

    Re: Getting info from a website using VBA

    The info i am trying to get is the
    Please Login or Register  to view this content.
    bit

  5. #5
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Getting info from a website using VBA

    Unfortunately the web page is not very well tagged.
    So you first need to identify how to find the data from the source code.
    it is surrounded by the tag <b>text you want</b>
    therefore we get all the <b>tags as a collection and pick out the 8th element (1st one is a 0, therefore we use 7)

    Please Login or Register  to view this content.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  6. #6
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Getting info from a website using VBA

    or you can use this part instead

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-12-2005
    Posts
    21

    Re: Getting info from a website using VBA

    First Reponse roked perfectly.

    Your a star thanks

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Getting info from a website using VBA


    content is not a tagname neither the name (that is ICBM) …

    Other way :
    Please Login or Register  to view this content.

+ 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. Pull info from website
    By Benjamin2008 in forum Excel General
    Replies: 1
    Last Post: 06-25-2010, 07:49 PM
  2. Info from website
    By JRLats in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2009, 10:20 PM
  3. Enter Cell Info, Retrieve Info from Website, Record Results
    By DrSues02 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-17-2009, 09:03 AM
  4. Retrieving latest info from a website
    By Lancashirethorn in forum Excel General
    Replies: 3
    Last Post: 11-08-2007, 06:26 AM
  5. download info from website
    By sashun in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-22-2007, 10:42 AM

Tags for this Thread

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