I\'m trying to scrape a website, but it gives me an error.
I\'m using the following code:
import urllib.request from bs4 import BeautifulSoup get =
For those still getting this error, adding encode("utf-8") to soup will also fix this.
encode("utf-8")
soup
soup = BeautifulSoup(html_doc, 'html.parser').encode("utf-8") print(soup)