- Make sure Python is installed on your system.
- Create folder web-scraping-with-python
- Open with favorite text editor
- Create
main.py
file - Create first Hello World program by adding the following code to the file.
Run program in terminal
print("Hello World!")
python main.py
- Install Beautiful Soup and requests.
pip install beautifulsoup4 requests
In a Python 3 environment on a Mac, you may run into errors when trying to import beautifulsoup4 and requests. Try this in your shell:
# from (my-env) *[main][/usr/local/projects/python/web-scraping-with-python]$
python3 -m venv my-env
source my-env/bin/activate
pip install beautifulsoup4 requests
python3 main.py