VBA code to get business address from google search

EricJAW

New Member
Joined
Jul 29, 2019
Messages
1
Good evening, everyone.

I was searching on forums on how to make a VBA Code where my excel could get business's full address, using the google seach result.

Since I am no expert in VBA, I've tried several similar threads but I am having a huge difficult. I will really appreciate if anyone can help me.

So far, what I've got is:

If we search the company on google using the below path, we will get a big box (in most of cases) at the body of the page, with the full address.

[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
*path i.e: https://www.google.com/search?q=Marriot+Worldwide+Corporation+USA+address&amp

So in excel I've used:
  • Column A: (List of) Business Names (Info that I've got)
  • Column B: (List of) Full Address (Info that I want to get)
  • Column C: URL with the google path to get the address.

The following columns I've used to make a form to get the URL exactly as the path shown above to include it at the Column C, so it can be used at the VBA to get the address automatic in all rows at once.

Inspecting the element, I could see that the address is located at the body, but at a DIV CLASS, so It's bugging me a lot to get it.

Doing some adjustments on the codes i've read on this forum, my cell was able to open the Internet Explorer in the right page, but I simply can't get the info.

It will be really appreaciated if someone can help me with that.

Ps.: Sorry about any English mistake. It's not my first language.

Thank you!
[/FONT]
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top