Copy any prompt below with one click and paste it directly into Claude, ChatGPT, or Gemini.
Generates Cell 1 (environment setup) and Cell 2 (auto-scrolling scraper + Excel export & download).
Write a complete Python solution designed to run smoothly inside Google Colab to scrape business leads from Google Maps without using any APIs.
Structure the response into TWO separate code blocks so my viewers can run them in two separate Google Colab cells:
### Cell 1: Installation Setup (For First-Time Users)
Provide all necessary shell commands (`!pip install` and `!apt-get`) to install Playwright (or Selenium with headless Chromium), Pandas, and `openpyxl` (for Excel export) cleanly in the Google Colab Linux environment.
### Cell 2: Main Scraper Script
Write the complete scraping code with these exact requirements:
1. Target Variable at the Top: Place a clean configuration section at the very top with `TARGET_KEYWORD = "Restaurants in Lahore"` so anyone can easily change the keyword.
2. Direct URL Navigation: Automatically encode `TARGET_KEYWORD` into a direct Google Maps search URL (`https://www.google.com/maps/search/{encoded_keyword}`) and navigate directly to avoid search-bar issues and captcha triggers.
3. Auto-Scrolling Logic: Smoothly scroll inside the Google Maps left-hand results panel to load as many listings as possible until reaching the end of the list.
4. Data Fields to Extract: For each business listing, extract:
- Business Name
- Full Address
- Phone Number
- Star Rating
- Google Maps Business Link (Direct URL of that specific listing)
5. Stability & Error Handling: Use realistic random delays, a desktop User-Agent, and `try-except` blocks so missing phone numbers, addresses, or ratings are saved as "N/A" without crashing the script.
6. Excel Output & Auto-Download: Save the extracted data into a clean Excel file (`.xlsx`) named dynamically after the `TARGET_KEYWORD` (e.g., `Restaurants_in_Lahore.xlsx`), print a preview of the first 10 rows in Colab, and automatically trigger a browser download using `google.colab.files.download()`.
Provide clean, well-commented, copy-pasteable code for both cells without unnecessary extra text.
Finds lucrative "Business Type in City" keywords for industries that actively pay for fresh lead lists.
Act as a B2B Lead Generation Expert. I have a Google Maps scraper script where I enter a search keyword in the format "[Business Category] in [City/Country]" to extract business contact details (Name, Address, Phone Number, Rating). Give me the top 5 highest-paying Google Maps search keywords for businesses that actively BUY B2B leads, cold-calling lists, or local business data. Rules for your output: 1. Target lucrative markets (like USA, UK, UAE, or Canada) where businesses have high budgets for leads. 2. Format each keyword strictly as `"Business Type in City"` so I can directly copy and paste it into my Python script's `TARGET_KEYWORD` variable. 3. Keep the explanation to just one short line per keyword explaining why they buy data.
Creates a concise pitch under 60 words offering 20 free verified sample leads before selling.
Write a short, high-converting cold outreach message (for WhatsApp and Email) to pitch B2B business leads to a Digital Marketing Agency or Real Estate company. Keep it under 60 words, friendly, non-spammy, and offer a free sample of 20 verified leads (Name, Phone, Address, Rating) first so they can check the quality before buying.