Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
193 views
in Technique[技术] by (71.8m points)

Web Scraping - Google Map Website - is it possible to scrape?

Just joined SO so I was wondering if you can help me with this issue. We used to scrape a website and get all the contact information for crossfit gyms in the US/world as the information was pretty exposed out there. Now, however, they have changed their website to map.crossfit.com so the information is embedded within a google style map, so you can only actually get the information for each gym (name, address, phone #, etc.) by zooming in and choosing them one by one, which would take me forever just to get all the US ones (approximately 6,000).

I'm not an expert in programming so I'm assuming that if the information is still there, there should be a way to scrape it. Can you guys give tell me if that is possible and possibly give me some hints on that?

Really appreciate your help! Rick

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Hello you can use the next command=

curl 'https://map.crossfit.com/getAffiliateInfo?aid=9347'

The output looks like -

{"name":"CrossFit Radiate","website":"http://www.crossfitradiate.com/","address":"149 S. Fowler St","city":"Bishop","state":"CA","zip":"93514","country":"United States","cfkids":true,"phone":"(760) 920-7519","courses":[]}

yo will get a json with all the information about the gym...

-if you change the request in the variable aid=1-

the output--

"name":"Golden State CrossFit","website":"http://goldenstatecrossfit.com/","address":"11174 La Grange Ave","city":"Los Angeles","state":"CA","zip":"90025","country":"United States","cfkids":false,"phone":"(818) 665-6512","courses":[]}

--Make a foor loop--

And change the value adding +1 to the value

--The info can be parsed from json to csv, or excel, or

--Regards--


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...