Skip to content

Instantly share code, notes, and snippets.

@DanielSmith
Created March 28, 2024 00:06
Show Gist options
  • Save DanielSmith/ceb42c26b3ed4c4bc40baf9343f07db6 to your computer and use it in GitHub Desktop.
Save DanielSmith/ceb42c26b3ed4c4bc40baf9343f07db6 to your computer and use it in GitHub Desktop.
update for python scrape README

Intro to webscraping with python

  1. Make sure Python is installed on your system.
  2. Create folder web-scraping-with-python
  3. Open with favorite text editor
  4. Create main.py file
  5. Create first Hello World program by adding the following code to the file.
    print("Hello World!")
    Run program in terminal
    python main.py    
    
  6. Install Beautiful Soup and requests.
    pip install beautifulsoup4 requests
    

Installing on Mac

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment