Chocolate Scraping with Beautiful Soup (UnicodeEncodeError)

Exercise: LEARN WEB SCRAPING WITH BEAUTIFUL SOUP - Chocolate Scraping with Beautiful Soup


My problem: I’m getting…

“Traceback (most recent call last):
File “”, line 12, in
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\xa0’ in position 991: ordinal not in range(128)”

My code:

import codecademylib3_seaborn
from bs4 import BeautifulSoup
import requests
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

webpage = requests.get("")

soup = BeautifulSoup(webpage.content, "html.parser")


I copied this from another forumpost, but the author deleted it. But I still don’t know how to fix this. Can anyone please help?

Hi @benjamin_the_coder,

To resolve this problem, see the discussion Beautiful Soup Chocolate Project.

1 Like