Scraping Google Maps for business information

636 views
Skip to first unread message

Justin K

unread,
Sep 13, 2014, 3:21:58 AM9/13/14
to web-s...@googlegroups.com
Hi There - I am trying to scrape businesses and their contact information.  I have tried numerous configurations, but it doesn't seem to work right.  I can scrap a single page, but want the system to click next and repeat on multiple pages.  Ideally, I want it to scrape the name and phone numbers on the query of my choice for approximately 20 pages of results.

Thanks for any help and I am happy to pay for support to get this to work.

Justin


{"startUrl":"https://www.google.com/maps/search/landscaping/@33.896607,-118.31341,11z/am=t","selectors":[{"parentSelectors":["_root"],"type":"SelectorElementClick","multiple":false,"id":"elements","selector":"div.text-place-list","delay":"","clickElementSelector":"a.text-place-pagination-button:nth-of-type(2)","clickType":"clickMore","discardInitialElements":false},{"parentSelectors":["elements"],"type":"SelectorText","multiple":true,"id":"name","selector":"div.text-place:nth-of-type(n) h3.text-place-title","regex":"","delay":""},{"parentSelectors":["elements"],"type":"SelectorText","multiple":true,"id":"phone","selector":"div.text-place:nth-of-type(n) span.text-place-phone:nth-of-type(3)","regex":"","delay":""}],"_id":"landscapingbusinesses"}

Mārtiņš Balodis

unread,
Sep 13, 2014, 4:44:59 AM9/13/14
to web-s...@googlegroups.com
Hi,
When using Element click selector you should specify delay between clicks and also multiple elements should be selected instead of one. I just published the documentation and tutorials on webscraper.io that would help with that. There is a video tutorial specially for the element click selector. I also attached the sitemap for this landscaping site. It looks really nice how the map moves when when the "next" button is clicked :) Currently I cannot accept donations because I haven't investigated how the tax payment system works here.

{"selectors":[{"parentSelectors":["_root"],"type":"SelectorElementClick","multiple":true,"id":"elements","selector":"div.text-place:nth-of-type(n+6)","delay":"2000","clickElementSelector":"a.text-place-pagination-button:nth-of-type(2)","clickType":"clickMore","discardInitialElements":false},{"parentSelectors":["elements"],"type":"SelectorText","multiple":false,"id":"title","selector":"h3.text-place-title","regex":"","delay":""},{"parentSelectors":["elements"],"type":"SelectorText","multiple":false,"id":"phone","selector":"span.text-place-phone:nth-of-type(3)","regex":"","delay":""},{"parentSelectors":["elements"],"type":"SelectorText","multiple":false,"id":"address","selector":"span.text-place-address","regex":"","delay":""},{"parentSelectors":["elements"],"type":"SelectorText","multiple":false,"id":"place-details","selector":"div.text-place-basic-details","regex":"","delay":""}],"startUrl":"https://www.google.com/maps/search/landscaping/@33.896607,-118.31341,11z/am=t","_id":"landscapingbusinesses"}

Justin K.

unread,
Sep 16, 2014, 10:01:35 PM9/16/14
to Mārtiņš Balodis, web-s...@googlegroups.com
I tried the code and it worked well.  Thank you so much for the help!

Justin



--
You received this message because you are subscribed to a topic in the Google Groups "Web Scraper" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web-scraper/pChHacQXsxs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web-scraper...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jfell

unread,
Jun 14, 2016, 2:44:43 PM6/14/16
to Web Scraper
I attempted to use this code, but got zero results when I scraped. Is this code still valid? I am trying to scrape local google maps results.

Thanks

Mārtiņš Balodis

unread,
Jun 22, 2016, 6:25:15 AM6/22/16
to Jfell, Web Scraper
Hi Jfell,
The sitemap isn't working because the page has changed. Basically you need to update the CSS selectors to make it work again.

--
You received this message because you are subscribed to the Google Groups "Web Scraper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to web-scraper...@googlegroups.com.

johnsm...@gmail.com

unread,
Feb 18, 2017, 5:33:48 AM2/18/17
to Web Scraper
Hi Martin,

I tried to use this code for my sitemap, but i can't able to scrape all the data. It scrapes only one data from the list. So please find my sitemap and let me know. I'm really struggling for more than three days. I need you help.

Thanks.

{"_id":"parks-uk","startUrl":"https://www.google.com/maps/search/parks+in+London,+UK/@51.5081667,-0.4213292,10z/data=!3m1!4b1","selectors":[{"parentSelectors":["_root"],"type":"SelectorElementClick","multiple":true,"id":"element","selector":"div.widget-pane-content","clickElementSelector":"h3.section-result-title span","clickElementUniquenessType":"uniqueText","clickType":"clickOnce","discardInitialElements":false,"delay":"2000"},{"parentSelectors":["element"],"type":"SelectorText","multiple":false,"id":"name","selector":"h1","regex":"","delay":""},{"parentSelectors":["element"],"type":"SelectorText","multiple":false,"id":"address","selector":"div.section-info:nth-of-type(4) span.section-info-text span:nth-of-type(1) span","regex":"","delay":""},{"parentSelectors":["element"],"type":"SelectorText","multiple":false,"id":"phone","selector":"div.section-info:nth-of-type(6) span.section-info-text > button.widget-pane-link","regex":"","delay":""}]} 
Reply all
Reply to author
Forward
0 new messages