Business directories enable users to search for companies, services, or providers in a specific area in a more targeted manner. A business directory is similar to an online category of the Yellow Pages. Almost all business directories contain an index of companies listed in alphabetic order by industry—the individual entry links to the related company’s website.
The listings provide information related to specific businesses, including name, contact information, address, associations, services, or products offered. The businesses are available by activity, size, or location. However, your business must include all relevant information in business directories. Failure to do so can confuse potential customers. If you are new to the business and wondering what info must enhance your business's visibility, the best option is to scrape business directories using Yellow Pages scraper.
Your company listing must have the following information before adding it to a directory:
There are still several things to include in the company listing. Scrape business listing to know what your competitors have added differently.
Some of the well-known business directories are as follows:
The following data are available from business directories
Here, we are taking the example of Yellow Pages to scrape and crawl business directories contact details using Python. Yellow Pages consist of massive data for businesses. In this corporate world, lead generation is a crucial factor. And you must be aware of it. It is a process where you approach prospective clients via emails, messages, or calls and make them aware of your products and services. And if they like your offer, they will purchase it from you.
Now, the question arises, how will you generate leads and scrape data to get emails or contact numbers? So, here comes the role of business directory scraping services. In this blog, we will scrape Yellow Pages to obtain contact numbers and other details.
Suppose you are a kitchen utensil dealer or manufacturer looking for a prospective buyer. In such a situation, restaurants will be your primary targets. Hence, we will scrape restaurant details from the yellow pages. We are more interested in getting the name, address, and phone number. We are targeting restaurants in New York. Consider this URL.
We will use Python to scrape leads from business directories. Further, we will use requests and beautifulsoup for task execution.
Create a folder and install these libraries.
Let’s start with the coding process.
Create a file and name it.
Here, we will use ypages.py. Import the installed libraries.
Now, declare the target website for yellow page scraping.
We have made the GET request using the request library for our target website. We will first inspect the web page to check where all results are stored.
We are using BS4 on the stored data in the resp variable for creating an HTML tree.
We can see that all results are under the div tag with the class ‘result.’ We will find the name, address, and contact number within this div.
The name lies under a tag with a class name as ‘business name”. Next, we will check for phone numbers.
The address is within the div tag having class name as adr. Now, we have all the information with us. So, we will extract the data by running a loop.
On printing, you will get this.
We have successfully scraped all the target data. But how to scrape emails and websites? For this, we will first check the locations of email and website addresses for a specific restaurant's Yellow Pages.
The website lies within a tag inside the href attribute.
The email is within the href attribute with a tag.
Our objective in scraping all these details is to generate a new target website for each restaurant. For example, the URL for Mr. K’s restaurant is:
The section till .com will remain the same, but the string after that will change according to the restaurant.
Now, we will scrape our data of interest.
We will make specific changes in the last ‘for’ loop.
Our new target_website is a link to the dedicated page. We will then extract data from these pages.
The BS4 .get() function will help us to extract data from any attribute. After printing, we can have all emails and website URL
The final complete code is ready for cold emailing or cold calling.
Thus, we learned how to create a target prospect list for your company using business directories data scraping. The proper business directory scraper can help extract valuable business data from target websites. Collecting prospects is not limited to Yellow Pages but can be done similarly from all business directories. IWeb Data Scraping provides the best-automated business directory scraping services using tools and techniques that are GDPR compliant.
For more information, get in touch with iWeb Data Scraping now! You can also reach us for all your web scraping service and mobile app data scraping requirements.