Do a Simple Web Scrapping with Python — Part 3: Set up

Muhammad Al Fatih
3 min readApr 6, 2022

--

Setting up a Virtual Environment and Installing Beautiful Soup 4 & Requests packages

In this part, we’ll be setting up a Virtual Environment first before starting our project. Why? Because Virtual Environment is used to manage python packages for different purposes. Using Virtual Environment allows us to avoid installing Python packages globally which could break system tools or other projects. We do this to keep all the packages of your project managed well. Then we’ll start to install the Beautiful Soup 4 package to read HTML files and requests package to get the HTML file.

Setting up Virtual Environment:

  1. Open your last project on PyCharm.
  2. On the left bottom of PyCharm, click Python 3. xx, then select Add Interpreter.

3. Make sure you select Virtualenv Environment, then click ok in this window

4. After the loading finishes, you’ve done it!

Installing Packages:

  1. Go to File → Setting → Project: xxx → Python Interpreter. This window will show you the list of packages that were installed in this project, click the + button to add a new package.

2. Available Packages window will open. Type beautifulsoup4 in the search box, then click the Install Package button to install the package including the dependencies packages(a sub-package that is required to support the function of the main package)

3. Next, repeat the process to install requests package.

4. After you’ve finished all the package installation, you can close the window and see the package is added to the list. Then, you can click OK to close the window.

Congrats! You’ve set up a Virtual Environment for your project, plus installed all the packages we need! Next, we’ll show you the concept of our program and then start the coding!

Continue to the Next Article

--

--