I am currently taking a course on Python and during our unit on Beautiful Soup the instructor uses the following code:
import requests, pprint
from bs4 import BeautifulSoup
url = 'https://www.epicurious.com/search/tofu%20chili'
response = requests.get(url)
page_soup = BeautifulSoup(response.content, 'lxml')
print(page_soup.prettify())
When I run this code, I get the following error:
Traceback (most recent call last):
File "/Users/arocklin/Documents/Python/whiteboard2.py", line 11, in <module>
print(page_soup)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1479: ordinal not in range(128)
I was wondering why I got this since it worked for him and how I can fix it going forward. Thanks!