Exercise: LEARN WEB SCRAPING WITH BEAUTIFUL SOUP - Chocolate Scraping with Beautiful Soup
My problem: I’m getting…
“Traceback (most recent call last):
File “script.py”, line 12, in
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\xa0’ in position 991: ordinal not in range(128)”
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("https://s3.amazonaws.com/codecademy-content/courses/beautifulsoup/cacao/index.html") soup = BeautifulSoup(webpage.content, "html.parser") print(soup)
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?