D
D
Dmitry Petrov2020-06-05 17:08:08
Google Sheets
Dmitry Petrov, 2020-06-05 17:08:08

How to import information from Google.Maps to Google Sheets?

For the first time I am trying to import the rating, the number of reviews, the reviews themselves and the feedback from a point in Google.Maps into Google Sheets, but in vain.
Using the example of Gorky Park, I prescribe the following:
1. Assessment:

=IMPORTXML("https://www.google.com/maps/place/%D0%9F%D0%B0%D1%80%D0%BA+%D0%93%D0%BE%D1%80%D1%8C%D0%BA%D0%BE%D0%B3%D0%BE/@55.7319761,37.602458,17z/data=!3m1!4b1!4m5!3m4!1s0x46b54b08f4ce8d87:0x35da41a8337eb8e8!8m2!3d55.7319761!4d37.6046467";"//span[@jsan='7.widget-pane-link,0.aria-label,0.vet,0.jsaction']")

2. Number of reviews
=IMPORTXML("https://www.google.com/maps/place/%D0%9F%D0%B0%D1%80%D0%BA+%D0%93%D0%BE%D1%80%D1%8C%D0%BA%D0%BE%D0%B3%D0%BE/@55.7319761,37.602458,17z/data=!3m1!4b1!4m5!3m4!1s0x46b54b08f4ce8d87:0x35da41a8337eb8e8!8m2!3d55.7319761!4d37.6046467";"//span[@jsan='7.widget-pane-link,0.aria-label,0.vet,0.jsaction']")

3. Reviews themselves with feedback
=IMPORTXML("https://www.google.com/maps/place/%D0%9F%D0%B0%D1%80%D0%BA+%D0%93%D0%BE%D1%80%D1%8C%D0%BA%D0%BE%D0%B3%D0%BE/@55.7319761,37.602458,17z/data=!3m1!4b1!4m5!3m4!1s0x46b54b08f4ce8d87:0x35da41a8337eb8e8!8m2!3d55.7319761!4d37.6046467";"//span[@div='jstcache']")

Tell me, please, what is the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Boev, 2020-06-05
@ProgrammerForever

If you get data by this url, then you can see that initially there is no information there, i.e. all payloads are loaded by JavaScript. If you throw out everything superfluous, scripts and styles, then the following code is returned:

<!DOCTYPE html>
<html itemscope="" itemtype="http://schema.org/Place" lang="en">

<head>
    <title> Google Maps </title>
</head>

<body class="keynav-mode-off" tabindex="-1">
    <noscript>
        <div id="no-script">
            <div class="no-script-message">
                <div> When you have eliminated the <strong>JavaScript</strong>, whatever remains must be an empty page. </div> <a class="no-script-help-link" href="//support.google.com/maps/?hl=en&amp;authuser=0&amp;p=no_javascript" target="_blank"> Enable JavaScript to see Google Maps. </a>
            </div>
        </div>
    </noscript> 
</body>

</html>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question