2024-10-01 11:23:11 发布
网友
start_url=requests.get('http://www.delicious.com/golisoda') soup=BeautifulSoup(start_url)
此代码显示以下错误:
from BeautifulSoup import BeautifulSoup import urllib2 data=urllib2.urlopen('http://www.delicious.com/golisoda').read() soup=BeautifulSoup(data)
你可能需要使用
使用
soup=BeautifulSoup(start_url.read())
或者
使用响应的.content:
.content
start_url = requests.get('http://www.delicious.com/golisoda') soup = BeautifulSoup(start_url.content)
或者,您可以使用解码的unicode文本:
请参阅文档的Response content section。在
你可能需要使用
使用
或者
^{pr2}$使用响应的
.content
:或者,您可以使用解码的unicode文本:
^{pr2}$请参阅文档的Response content section。在
相关问题 更多 >
编程相关推荐