0
我想在Python運行一個非常簡短的腳本如何使用PYTHONIOENCODING環境變量讓過去一個Unicode解釋問題
from bs4 import BeautifulSoup
import urllib.request
html = urllib.request.urlopen("http://dictionary.reference.com/browse/word?s=t").read().strip()
dhtml = str(html, "utf-8").strip()
soup = BeautifulSoup(dhtml.strip(), "html.parser")
我問過類似的問題早了,這個問題一直立足於創建J塞巴斯蒂安對他的回答給予了可敬的評論。 Python program is running in IDLE but not in command line
有沒有一種方法來設置PythonIOEncoding早些時候在任GitHub的Atom或崇高文本2自動編碼soup.prettify()
到utf-8
我要在服務器上運行這個程序(當然,目前部分只是一個快速測試)