Scrap Google Maps Short URL

Hi, I am trying to generate and scrap the Google Maps Short URL for a number of searches.
I am able to see the link in the data preview, but nothing it's scrapped when I launch the job.
Could you please indicate me the way? Many Thanks!

Example with two searches:

{"_id":"tst_google_maps","startUrl":["https://www.google.it/maps/place/Museo+Ferrari+Maranello/@44.5290696,10.8576357,3749m/data=!3m1!1e3!4m5!3m4!1s0x4781e629e2ffffff:0x78dd8a4915609a5b!8m2!3d44.5300925!4d10.8611959","https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY"],"selectors":[{"id":"link","type":"SelectorPopupLink","parentSelectors":["_root"],"selector":"img[alt='Condividi']","multiple":false,"delay":"500"},{"id":"Copy_Link","type":"SelectorHTML","parentSelectors":["link"],"selector":"div.section-copy-link-input-container","multiple":false,"regex":"","delay":0}]}

Change your 'Copy_Link' selector to be an 'Element Attribute' selector. Use 'div.section-copy-link-input-container input' as the CSS selector and 'value' as the attribute name.

Many thanks for your suggestion, I tried to modify the code but when launching it it still does not scrap the 2 short URLs. I also added a delay of 2000 ms.
Does it work for you?

{"_id":"tst_google_maps2","startUrl":["https://www.google.it/maps/place/Museo+Ferrari+Maranello/@44.5290696,10.8576357,3749m/data=!3m1!1e3!4m5!3m4!1s0x4781e629e2ffffff:0x78dd8a4915609a5b!8m2!3d44.5300925!4d10.8611959","https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY"],"selectors":[{"id":"link","type":"SelectorPopupLink","parentSelectors":["_root"],"selector":"img[alt='Condividi']","multiple":false,"delay":"2000"},{"id":"Copy_Link","type":"SelectorElementAttribute","parentSelectors":["link"],"selector":"div.section-copy-link-input-container input","multiple":false,"extractAttribute":"value","delay":"2000"}]}

I guess I should have ran it instead of a quick data preview. I got it figure out for you though. Here's what I used but keep in mind I'm on the US version of google so make sure to change the image alt text back.

{"_id":"aa3","startUrl":["https://www.google.it/maps/place/Museo+Ferrari+Maranello/@44.5290696,10.8576357,3749m/data=!3m1!1e3!4m5!3m4!1s0x4781e629e2ffffff:0x78dd8a4915609a5b!8m2!3d44.5300925!4d10.8611959","https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393&query_place_id=ChIJKxjxuaNqkFQR3CK6O1HNNqY"],"selectors":[{"id":"link","type":"SelectorElementClick","parentSelectors":["_root"],"selector":"jsl","multiple":false,"delay":"2000","clickElementSelector":"img[alt='Share']","clickType":"clickOnce","discardInitialElements":"discard","clickElementUniquenessType":"uniqueText"},{"id":"Copy_Link","type":"SelectorElementAttribute","parentSelectors":["link"],"selector":"div.section-copy-link-input-container input","multiple":false,"extractAttribute":"value","delay":"2000"}]}

1 Like

Thanks, I have been trying to figure out Google Maps scraping too. This'll be useful.

Many Many Thanks NetwokReject!
I changed "img[alt=Share]" to my local language and it works perfectly.