How to scrape detailed location data from google maps?

Dataflow Kit offers a service for extracting data from Google Maps.


It is suitable for parsing data from similar points of interest from GMaps. For example, you can search for "restaurants in New York" or scrape info about "pharmacies near Amsterdam."

How to extract more details about a particular place on the map?

If you look at the screenshot below, you can see that the resulting data for one location has an entirely different structure. Since the data coming from a single result page is significantly different from the data coming from a page with multiple results, you need to create another Google Maps parser.

We strive to keep the scraping scripts fresh and up-to-date, even though Google is constantly changing the layout of its websites.

There is no dedicated visual builder for extracting details of a single location yet, but I  would like to share the payload to extract data from a specific place from google maps.

{
  "fields": [
    {
      "attrs": [
        "text"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "Title",
      "selector": "div.jhZ71jGpxeA__section-hero-header-title-description > div:nth-child(1) > h1 > span:nth-child(1)"
    },
    {
      "attrs": [
        "src"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "selector1",
      "selector": "div.section-hero-header-image-hero-container.collapsible-hero-image > button > img"
    },
    {
      "attrs": [
        "text"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "Address",
      "selector": "div:nth-child(1) > button > div.ugiz4pqJLAG__content > div.ugiz4pqJLAG__text > div.ugiz4pqJLAG__primary-text.gm2-body-2"
    },
    {
      "attrs": [
        "text"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "URL",
      "selector": "div:nth-child(3) > button > div.ugiz4pqJLAG__content > div.ugiz4pqJLAG__text.ugiz4pqJLAG__underline_on_hover > div.ugiz4pqJLAG__primary-text.gm2-body-2"
    },
    {
      "attrs": [
        "text"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "Phone",
      "selector": "div:nth-child(4) > button > div.ugiz4pqJLAG__content > div.ugiz4pqJLAG__text > div.ugiz4pqJLAG__primary-text.gm2-body-2"
    },
    {
      "attrs": [
        "text"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "PlusCode",
      "selector": "div:nth-child(5) > button > div.ugiz4pqJLAG__content > div.ugiz4pqJLAG__text > div.ugiz4pqJLAG__primary-text.gm2-body-2"
    },
    {
      "attrs": [
        "text"
      ],
      "filters": [
        {
          "name": "trim",
          "param": ""
        }
      ],
      "name": "Reviews",
      "selector": "span.lCHJiM2nCQs__reviews-tap-area.lCHJiM2nCQs__reviews-tap-area-enabled > span:nth-child(1) > button"
    }
  ],
  "format": "json",
  "name": "Google Maps",
  "payloadmd5": "",
  "request": {
    "actions": [
      {
        "click": {
          "selector": "form > div.lssxud > div > button, #pane > div > div.widget-pane-content.mapsConsumerUiCommonScrollable__scrollable-y > div > div > div.section-layout.section-layout-flex-horizontal"
        }
      },
      {
        "waitVisible": {
          "selector": "#pane > div > div.widget-pane-content.mapsConsumerUiCommonScrollable__scrollable-y > div > div"
        }
      }
    ],
    "ignoreHTTPStatusErrCodes": false,
    "proxy": "country-any",
    "type": "chrome",
    "url": "https://www.google.com/maps/search/Edeka+Hauptstr+23+13158+Berlin/"
  }
}
DFK Payload for Gmaps data extraction.

Here is the link to the Public Gist at GitHub:

https://gist.github.com/slotix/c37de29baa12ec9d5805d8e8e8e25b92

Dashboard with Gmaps payload
  1. Paste the contents of the payload into a new task in the control panel.
  2. Manually change your search query to your desired location on Google Maps. In our example "Edeka+Haupstr+23+13158+Berlin".
  3. Run Process and Download Results.

Conclusion.

These 1-2-3 steps above are enough to retrieve information about a particular establishment or points of interest from Google Maps.

The following fields can be scraped:

  1. Cover Photo.
  2. Title.
  3. Address
  4. URL
  5. Phone Number
  6. Plus code

This payload can be easily customized to suit your specific needs.

Happy scraping!