Download parser_1.py from BluechipTechnologiesAsia/Google-Maps.Location-data-scraper: direct link, hf CLI and curl.
- Browser
- Download file 603 Bytes
-
https://huggingface.co/spaces/BluechipTechnologiesAsia/Google-Maps.Location-data-scraper/resolve/main/parser_1.py
- Command line
-
hf download hf://spaces/BluechipTechnologiesAsia/Google-Maps.Location-data-scraper/parser_1.py
-
curl -L -o parser_1.py https://huggingface.co/spaces/BluechipTechnologiesAsia/Google-Maps.Location-data-scraper/resolve/main/parser_1.py
603 Bytes
| from sc_google_maps_api import ScrapeitCloudClient | |
| import json | |
| def gmaps_parser(location, country_code): | |
| client = ScrapeitCloudClient(api_key='06dbfb89-957c-4263-ad72-1a016669e8f8') | |
| params = { | |
| "keyword": location, | |
| "country": country_code, | |
| "domain": "com" | |
| } | |
| try: | |
| response = client.scrape(params) | |
| data = json.loads(response.text) | |
| return data | |
| except Exception as e: | |
| return {"error": f"Maps cannot scrape the requested details."} |