+ Reply to Thread
Results 1 to 8 of 8

VBA code to extract data from Wikipedia

  1. #1
    Registered User
    Join Date
    03-11-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    97

    VBA code to extract data from Wikipedia

    Hi

    I have a Macro which extracts various suppliers data from Wikipedia
    This macro runs using the inspect element code from web

    While executing the code for various suppliers I am getting incorrect data


    Please Login or Register  to view this content.

    Ex. I have inspect element code (td)(9) to extract data for website in wike for Genpact. But Infosys (td) (9) is products

    I have enclosed the screen shots and a sample file for your perusal…

    Kindly advise
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: VBA code to extract data from Wikipedia

    Hi Kiran,

    I have done few little changes to resolve the problem.

    Please Login or Register  to view this content.
    Regards
    taps

    Note: If it is working for you then marked the thread as SOLVED
    and put some reputation
    Last edited by taps; 06-27-2013 at 07:10 AM.

  3. #3
    Registered User
    Join Date
    03-11-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA code to extract data from Wikipedia

    Hi Taps,

    Its working fine....great....But I have a question here

    I have alot of suppliers whom I need to run against wiki everyday...will this code work for them too?

    Thank you

    Regards
    Kiran Kumar

  4. #4
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: VBA code to extract data from Wikipedia

    Hi Kiran,

    It will work but for once you have to add a line like below..

    Please Login or Register  to view this content.
    Regards
    taps

  5. #5
    Registered User
    Join Date
    03-11-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA code to extract data from Wikipedia

    Taps... the problem is I have thousands of suppliers... I cant go for every supplier and fetch that information... and the supplier list keep changing from month to month....

    request you to please look into the enclosed word doc above...that will make my view clear...

    Kindly help

  6. #6
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: VBA code to extract data from Wikipedia

    Hi,

    Is there any code through which we can identify the table (where the list of data are present) ? as you have identified the each eliment by "td".

    regards
    taps

  7. #7
    Forum Contributor
    Join Date
    09-29-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2003/2007
    Posts
    182

    Re: VBA code to extract data from Wikipedia

    Hi Kiran,

    See the final solution (hopufully)

    Please Login or Register  to view this content.
    Regards
    taps


    Note: If it is working for you then marked the thread as SOLVED
    and put some reputation

  8. #8
    Registered User
    Join Date
    03-11-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: VBA code to extract data from Wikipedia

    Hi Taps

    Thanks for continuous help... "td" is extracted from Html code for that site... "To view the HTML code... right click on the website and click on Inspect element".... is there a way where we can use "ClasS" tag from HTML code and use Case function to get more accurate data....


    Thank you

    Regards
    Kiran Kumar

+ 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.6.0 RC 1