AttributeError: 'str' object has no attribute 'read' phyton3.5.1
AttributeError: 'str' object has no attribute 'read' phyton3.5.1
我想通过 Phynton 3.5.1 使用 urllib 库
代码:
import urllib.request
x = urllib.request.urlopen=("https://www.google.com")
print(x.read())
在 运行 之后我收到了下一条消息:
打印(x.read())
AttributeError: 'str' 对象没有属性 'read'
我正在学习下一个教程:https://www.youtube.com/watch?v=5GzVNi0oTxQ 之前的部分是最简单的部分。预先感谢您的帮助。
你打错了
import urllib.request
x = urllib.request.urlopen("https://www.google.com")
print(x.read())
你在第 2 行有一个额外的 =
。
我想通过 Phynton 3.5.1 使用 urllib 库
代码:
import urllib.request
x = urllib.request.urlopen=("https://www.google.com")
print(x.read())
在 运行 之后我收到了下一条消息:
打印(x.read()) AttributeError: 'str' 对象没有属性 'read'
我正在学习下一个教程:https://www.youtube.com/watch?v=5GzVNi0oTxQ 之前的部分是最简单的部分。预先感谢您的帮助。
你打错了
import urllib.request
x = urllib.request.urlopen("https://www.google.com")
print(x.read())
你在第 2 行有一个额外的 =
。