+ Reply to Thread
Results 1 to 3 of 3

Retrieve data from Google search and/or Wikipedia with VBA

  1. #1
    Registered User
    Join Date
    04-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    19

    Retrieve data from Google search and/or Wikipedia with VBA

    Hello,

    I am trying to automate a search in google with VBA, but I know where to start or even if its possible. I hope someone can give me a hint where to start.

    The problem: I have an excel table with city names and their corresponding region, etc. and I would like to include a new column with their area (km2). Since the list is veeeeeery long I would like to somehow automate the search. I realized, that when I google the string "city name & region" the first hyperlink returned is always to wikipedia. In wikipedia, there is always a table (at the right side) with geo-demographic data (population, official languages, etc. and AREA). Even sometime (in my case with Firefox), when I google that string I the list of hyperlinks and additionally a small table (widget?) from wikipedia, with some basic information of the city including the area.

    My idea:
    In the case of Firefox, search in the returned HTML code for a string similar to "Area: *** km2".
    In case of IE, access the first hyperlink (normally wikipedia's) and search into this HTML code for the string (similar as above)

    I also thought about querying DBpedia, but I think this will be even more complicated.

    Of course I dont expect a perfect output, but considering how large is my list, I think it will help.

    Sorry for my amateur terminology...I hope anyone can give me any hint on where to start or any other suggestions on how to approach this.

    Thanks a lot for your time!

  2. #2
    Valued Forum Contributor adyteo's Avatar
    Join Date
    01-10-2013
    Location
    Calgary
    MS-Off Ver
    Excel 2010
    Posts
    540

    Re: Retrieve data from Google search and/or Wikipedia with VBA

    I do not believe it is possible due to the structure of the webpages, even in Wikipedia.
    What you can do is create, from pages like: http://en.wikipedia.org/wiki/List_of...cities_by_area, a database with the cities (based on your needed country) and then link your excel file to that database (either excel, CS; etc).
    I hope it works.
    Click on the star if you think I helped you

  3. #3
    Registered User
    Join Date
    04-11-2013
    Location
    Germany
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Retrieve data from Google search and/or Wikipedia with VBA

    Thanks a lot. Unfortunately I dont think this will solve my problem... I will keep thinking.

    Thanks again!

+ 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. [SOLVED] VBA code to extract data from Wikipedia
    By Kiran Kurapati in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-28-2013, 05:17 AM
  2. [SOLVED] Search & retrieve data between sheets
    By brisser90 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2012, 03:13 PM
  3. Problem with search/retrieve data
    By sdrubezki in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 08-12-2010, 11:21 AM
  4. Replies: 0
    Last Post: 11-05-2009, 04:47 AM
  5. Use macro to search and retrieve data
    By tfries in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-22-2008, 01:35 PM

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