使用时出错Python 3、Sublime BeautifulSoup
Error when using Python 3, Sublime BeautifulSoup
简而言之,这是我的代码:
import requests
from bs4 import BeautifulSoup
import re
request = requests.get("http://www.yellowpages.com/")
soup = BeautifulSoup(request.content)
print(soup.find_all("a"))
鉴于上面的代码,我收到以下错误:
[Decode error - output not utf-8]
有人知道发生了什么事吗?我该如何解决?
干杯!
假设您正在使用 Windows:
我有一个类似的问题,配置系统路径已解决。要设置系统路径,请将 Python 文件夹(在我的示例中为 C:\Python3.5)添加到您的环境变量 "Path"。
计算机 > 左键单击 > 属性 > 高级系统设置 > 环境变量 > 查找 "Path" > 编辑。
不要忘记使用不带空格的分号。
之后重启 Sublime text,应该可以了。
简而言之,这是我的代码:
import requests
from bs4 import BeautifulSoup
import re
request = requests.get("http://www.yellowpages.com/")
soup = BeautifulSoup(request.content)
print(soup.find_all("a"))
鉴于上面的代码,我收到以下错误:
[Decode error - output not utf-8]
有人知道发生了什么事吗?我该如何解决?
干杯!
假设您正在使用 Windows: 我有一个类似的问题,配置系统路径已解决。要设置系统路径,请将 Python 文件夹(在我的示例中为 C:\Python3.5)添加到您的环境变量 "Path"。
计算机 > 左键单击 > 属性 > 高级系统设置 > 环境变量 > 查找 "Path" > 编辑。
不要忘记使用不带空格的分号。 之后重启 Sublime text,应该可以了。