2024-04-25 04:31:41 发布
网友
在Python3里试着用这个
try: x = urllib.request.urlopen('https://www.google.com/search?q=test') print(x.read()) except Exception as e: print(str(e))
我也遇到过同样的错误,我通过谷歌搜索解决了这个问题。 urlib.request适用于Python 3.0。
urlib.request
您可以使用以下代码:
import urllib urllib.urlopen(url)
已弃用urllib.request模块。。 只是使用
import urllib
如果你之前写的是
urllib.request.urlretrieve
现在你只要写信
urllib.urlretrieve
在Python3里试着用这个
我也遇到过同样的错误,我通过谷歌搜索解决了这个问题。
urlib.request
适用于Python 3.0。您可以使用以下代码:
已弃用urllib.request模块。。 只是使用
如果你之前写的是
现在你只要写信
相关问题 更多 >
编程相关推荐