UnicodeEncodeError: 'charmap' codec can't encode characters

后端 未结 8 709
感情败类
感情败类 2020-11-22 11:55

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 =          


        
8条回答
  •  春和景丽
    2020-11-22 12:47

    I fixed it by adding .encode("utf-8") to soup.

    That means that print(soup) becomes print(soup.encode("utf-8")).

提交回复
热议问题