Scrapping Website Data Using Python

Yash Chauhan
3 min readNov 7, 2021

--

In today’s competitive world everybody is looking for ways to innovate and make use of new technologies. Web scrapping provides a solution for those who want to get access to structured web data in an automated fashion. Web scrapping is useful if the public website you want to get data from doesn’t have an API, or it does but provides only limited access to the data.

What Is Web Scrapping?

Web scrapping is the process of collecting structured web data in an automated fashion. It’s also called web data extraction. Some of the main use cases of web scrapping include price monitoring, price intelligence, news monitoring, lead generation, and market research among many others.

For this practical, we scrape the data from Alibaba Suppliers' website using the Beautiful Soup library.

Process of Web Scrapping

1. Identify the target website

2. Collect URLs of the pages where you want to extract data from

3. Make a request to these URLs to get the HTML of the page

4. Use locators to find the data in the HTML

5. Save the data in a JSON or CSV file or some other structured format

Code Implementation

  1. Inspecting the Page and find data that you want

2. Import Dependencies

3. Store webpage content using requests and BeautifulSoup

Separate specific data from content using respective class-names and respective tags and then store that data into list.

store data for further use in the form of csv file.

Conclusion

We can fetch any data from a webpage by using a web scrapping library like beautiful soup, scrappy, etc. After converting into Pandas we can apply all pandas functions on that data.

--

--

No responses yet