use*_*680 2 python urllib python-3.x
import urllib.request
html = urllib.request.urlopen('http://jshawl.com/python-playground/')
s = html.read
print(s)
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
<0x032B18D0处<http.client.HTTPResponse对象的绑定方法HTTPResponse.read>>
我该如何解决这个错误?我犯了什么错误?
您看到的不是错误 - 您看到的是HTTPResponse实例方法字符串表示。要获取方法返回的内容,您应该调用它:
s = html.read()
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3455 次 |
| 最近记录: |