I require a script that will do the following:
1. Take as input a string used to search Google Maps through an HTML page with that field and a submit button.
2. Scrape the following data from the Google Maps results into an array of scraped-contact objects:
a. Company Name
b. Website URL
c. Phone Number
g. postal code
i. star rating
3. Looping through the results, script should crawl each website URL for email addresses and contact forms.
4. If no email address is found for a website, the contact form page URL will be saved to a contact-form variable.
5. If no contact form or email address is found, a notes variable will record, "no email or contact form available."
6. All data will be output to a .csv file
I plan to put this in a WordPress plugin wrapper accessible to admins only.