Have you ever thought you can make money by knowing how many restaurants there are in a square mile? There is no free lunch, however, if you know how to use Google Maps, you can extract and collect the restaurantâs GPS and store them in your own database.
By reading this article, you can learn about how to find the latitude and longitude on Google Maps, also the easy method to extract Google Maps coordinates.
How to Get Google Maps Latitude and Longitude
Sometimes, you may be curious about the accurate location of someplace or you need to share it with your friends. Finding the latitude and longitude on Google Maps will be a good choice. Here are some simple steps about how to get coordinates from Google Maps on Android, iPhone/iPad, and computer.
1. How to Find the Coordinates of A Place on Your Computer
First, open Google Maps on your computer, and right-click the place you want to get coordinates. A pop-up window will show, and you can find the latitude and longitude on the top. Left-click and copy them automatically.
2. Get Google Maps GPS Coordinates on Android/iPhone
Touch and hold an area of the map that isnât labeled to drop a red pin after opening the Google Maps app on your Android phone or iPhone device. If youâre an Android user, you can find the coordinates in the search box. For iPhone, tap Dropped pin to find the coordinates at the bottom.
You can read Googleâs official tutorial to get more information about finding and entering coordinates on Google Maps.
Steps to Extract Google Maps Coordinates
You may notice that the coordinates actually are hidden inside the URLs. In this case, we need to extract the URL and use Regular Expression to find the exact matching text string we are looking for. Letâs take the Space Needle landmark in Seattle as an example.
Run Octoparse Google Maps Scraper
First, open Google Maps in your browser and type âSpace Needleâ in the search bar. After the page finishes loading, look for the coordinates in the URL. The coordinates are located behind the â@â sign.
Next, we can start to extract the URL. The Google Maps coordinates extractor that we use is Octoparse â the best web scraping tool. It is easy to use, and you can scrape Google Maps and any websites without coding skills. You can download Octoparse and install it quickly on Windows/Mac.Â
Configure the Task of Scrape Google Maps Coordinates
Open Octoparse to build a task. Click â+â sign to enter the âAdvanced Modeâ. Input the URL into the box and hit âSaveâ to proceed.
Now we have created a new task successfully. The thing is that Google Maps doesnât load properly within its built-in browser. Why? It is because Google Maps doesnât accommodate with current browserâs user agent.
- To solve this problem, click the icon. Find the âUser-agent Switcher. Choose Firefox 45.0 and click the save option. Octoparse will reload the webpage itself.
- After the web page finishes loading, we are able to start extraction with a point-and-click on the built-in browser. Click the name, and the âAction Tipsâ panel will bring up the options that you can take. Select âExtract text of selected elementâ.
- Now you should notice that the extraction has been successfully created and added to the workflow below. We can edit the field name from the setting area on the upper right area by typing in the desired name.
- Go to the extraction field and find âAdd predefined fieldâ at the bottom. Click to bring up the dropdown menu, select âAdd current page informationâ and select âWeb page URL.â
- Now the web page URL has been added to the data field successfully. This is great! Of course, we need to edit the URL form to trim off the excess and pull the exact coordinates.
- Hit the âCustomizeâ icon (little pencil) at the bottom. Select âRefine extracted dataâ. Then click the âAdd Stepâ button. This brings you to a function list where you can choose for data cleaning. In this case, we select âMatch with regular expressionâ. You should arrive here.
- This allows you to edit the data the way you want by writing a Regular Expression. A regular expression is a special text string for describing a search pattern. Considering most people have difficulties writing the expression, we can use the built-in RegEx tool to help us. Click the âTry RegEx Toolâ button.Â
- Notice that we want to pull the part after the â@â sign but before the second comma. Check the âStart Withâ box, and input â@â. This is telling the RegEx that you want the part after the sign. Identically, check the âEnd Withâ box, and input â, 1â. As there are two commas behind the â@â, weâd better define which comma we want. Just simply add the number behind the comma, in this case, add number â1â This tells the RegEx that you want the part before the comma and number 1. Click the âGenerateâ button, the regular expression should be able to show in the box.
- Now just confirm if we set it properly by clicking the âMatchâ button. It generates the corresponding expression on the right. Boom! This is exactly what we want. Now go ahead and click âApplyâ then Click âOkâ to confirm.Â
Run the Google Maps Task
Thatâs it! You are done. Letâs run the crawler and see if it works. Click âStart Extractionâ and pick âLocal Extractionâ.
Video: Scrape Store Info from Google Maps
Now, what if you have 1000 addresses to look up? Donât worry, Octoparse allows you to input over 10,000 URLs when you set up the task. If you have any questions to set up a crawler, please reach out to support@octoparse.com. Octoparse is professionally designed to walk you through the journey from a beginner to a web scraping expert. We are here to help you become a master craftsman in the art of web scraping.