Make sure you have these modules installed in your python.
- BeautifulSoup(bs4)
- requests
- gspread
- smtplib (this module is generally pre-installed)
Scrape Data
- To scrape business information from Google Maps based on location and type, use BeautifulSoup and Requests libraries.
- Save the scraped data to a CSV file.
Google Sheets integration
- Go to google developers console and select a project or create a new project.
- Enable the Google Sheets API and obtain credentials. Set the key into JSON and download the JSON file.
- Once you have the credentials, store the file securely.
- Append data to a Google Sheets document through Python.
Generate personalized email text
- Use the OpenAI ChatGPT API to create personalized email text
The provided Python script generates personalized email content for lead-specific details like name and business information using the OpenAI ChatGPT API. To obtain API key from OpenAI, payment is required.
Email sending
- To send emails using the 'email.message' or 'email.mime' modules. import the necessary modules.
- If, using email.message with SSL, import the ssl module.
- Define the email content, including the subject, sender, reciever and the email body.
- Create an email message, attach the subject, sender, reciever, and email body. OR Import the email text using OpenAI ChatGPT API for personalized email text.
- Set up the SMTP server for your email service provider.
- For Gmail, use smtp.gmail.com with port 587 OR port 465 with SSL.
- Authenticate with your unique Google security code instead of using the actual Gmail password.
- If using 'email.message' with SSL, create a secure SSL connection to the SMTP server.
- Use the smtplib module to send the email.
Bibliography GFG OpenAI ChatGPT