{"id":22994754,"url":"https://github.com/lorennmarque/google-maps-scraper-fast","last_synced_at":"2025-07-18T01:14:36.186Z","repository":{"id":220549375,"uuid":"751405437","full_name":"LorennMarque/Google-Maps-Scraper-Fast","owner":"LorennMarque","description":"Plug \u0026 Play python Google Maps Scraper Business Info","archived":false,"fork":false,"pushed_at":"2024-11-17T02:29:01.000Z","size":219,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T07:22:12.273Z","etag":null,"topics":["google-maps-scraper-python","google-maps-scraping","scraper","scraping"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LorennMarque.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-01T14:50:52.000Z","updated_at":"2025-03-20T22:29:41.000Z","dependencies_parsed_at":"2024-04-21T17:49:00.690Z","dependency_job_id":"7970e105-eb8d-4afa-8b7c-59836792eaa9","html_url":"https://github.com/LorennMarque/Google-Maps-Scraper-Fast","commit_stats":null,"previous_names":["lorennmarque/plug-go-google-maps-leads-scrapper","lorennmarque/plug-go-google-maps-scrapper","lorennmarque/google-maps-scraper-fast"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LorennMarque/Google-Maps-Scraper-Fast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorennMarque%2FGoogle-Maps-Scraper-Fast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorennMarque%2FGoogle-Maps-Scraper-Fast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorennMarque%2FGoogle-Maps-Scraper-Fast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorennMarque%2FGoogle-Maps-Scraper-Fast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LorennMarque","download_url":"https://codeload.github.com/LorennMarque/Google-Maps-Scraper-Fast/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LorennMarque%2FGoogle-Maps-Scraper-Fast/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265687128,"owners_count":23811219,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-maps-scraper-python","google-maps-scraping","scraper","scraping"],"created_at":"2024-12-15T05:20:01.548Z","updated_at":"2025-07-18T01:14:36.164Z","avatar_url":"https://github.com/LorennMarque.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Maps Scraper\n\n## Overview\nThis script automates data scraping from Google Maps using Selenium. It performs searches based on user-provided queries, extracts detailed location information (name, coordinates, ratings, reviews, contact details, and more), and appends this data to a CSV file for further analysis.\n\n## Features\n* Automates searching and data extraction from Google Maps\n* Saves location data into a single CSV file named with a timestamp\n* Handles errors gracefully if some data fields are unavailable\n* Uses a configuration file (`config.json`) for query customization\n\n## Requirements\nBefore running the script, ensure the following are installed:\n\n* [Python 3.7+](https://www.python.org/)\n* Google Chrome\n* ChromeDriver (compatible with your version of Chrome)\n* Install Selenium package\n\n## Installation\n```bash\n# Clone or download the repository\n\n# Install required Python libraries\npip install selenium\n\n# Download ChromeDriver\n# Ensure ChromeDriver matches your Chrome version\n# Add ChromeDriver to your PATH\n```\n\n## Usage\n1. **Set up `config.json`:**\n   \n   Create a file named `config.json` in the root folder. Define your search queries as follows:\n   ```json\n   {\n       \"queries\": [\n           \"restaurants near me\",\n           \"cafes in New York\",\n           \"hotels in Paris\"\n       ]\n   }\n   ```\n\n2. **Run the script:**\n   ```bash\n   python script_name.py\n   ```\n\n3. **Access the output:**\n   \n   The results will be saved in the `output` folder with a filename like `scrap-YYYY-MM-DD_HH-MM-SS.csv`.\n\n\u003e **Usage tip:** As Google Maps limits the results per query, I strongly suggest using specific queries in the config.json file. For instance, specify query per state instead of a country.\n\n## Detailed Explanation\n\n### Code Workflow\n1. **Initialization:** The script creates an output folder and a CSV file with headers for storing location data.\n2. **Configuration Loading:** Reads search queries from `config.json`.\n3. **Google Maps Automation:**\n   * Launches Google Maps in a headless Chrome browser (or visible window for debugging)\n   * Performs searches using the provided queries\n4. **Data Extraction:** For each location result:\n   * Extracts data like name, coordinates, ratings, reviews, address, phone, and website\n   * Handles missing fields with fallback mechanisms\n   * Appends extracted data to the CSV file\n5. **Cleanup:** Closes the browser after processing all queries\n\n### Key Functions\n* `load_config`: Reads and parses the `config.json` file\n* `open_google_maps`: Initializes the Chrome WebDriver and opens Google Maps\n* `search_query`: Searches Google Maps using a provided query\n* `get_place_data`: Extracts details about a specific location\n* `click_all_elements`: Iteratively clicks on location elements and triggers data extraction\n* `append_to_csv`: Appends data to the CSV file\n\n## Output\nThe output is a CSV file saved in the `output` folder. The file includes the following fields:\n\n* `name`: Name of the place\n* `url`: URL of the Google Maps page for the place\n* `latitude`: Latitude of the location\n* `longitude`: Longitude of the location\n* `average_rating`: Average review rating (if available)\n* `review_count`: Number of reviews (if available)\n* `address`: Address of the location (if available)\n* `phone`: Phone number (if available)\n* `website`: Website URL (if available)\n\n## Troubleshooting\n* Ensure ChromeDriver is in your PATH and matches your Chrome version\n* If elements are not found, verify that Google Maps has not changed its DOM structure. Update selectors as needed\n* If the browser doesn't open or work properly, confirm that dependencies are installed correctly\n\n## Contact\nFor support or contributions, you can contact me at lorenzomarquesini@gmail.com","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florennmarque%2Fgoogle-maps-scraper-fast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Florennmarque%2Fgoogle-maps-scraper-fast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Florennmarque%2Fgoogle-maps-scraper-fast/lists"}