响应=请求.urlopen(url)不工作

2024-04-25 02:04:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我试过了,但总是错的。 有解决办法吗?下面是我使用的代码:

from urllib import request

url = "http://www.gutenberg.org/files/2554/2554.txt"

response = request.urlopen(url)

raw = response.read().decode('utf8')

type(raw)

this is an error that happened****


Tags: 代码fromorgimporttxthttpurlraw