|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
mport urllib.request
import urllib.parse
url="http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule&smartresult=ugc&sessionFrom=https://www.baidu.com/link"
date = {}
date['type']='AUTO'
date['i']='报纸'
date['doctype']='json'''
date['xmlVersion']='1.8'
date['keyfrom']='fanyi.web'
date['ue']='UTF-8'
date['typoResult']='true'
date =urllib.parse.urlencode(date).encode('uth-8')
response = urllib.request.urlopen(url,date)
html = response.read().decode('utf-8')
print(html)
C:\Users\admin\AppData\Local\Programs\Python\Python36\python.exe D:/练习存放/1
C:\Users\admin\AppData\Local\Programs\Python\Python36\python.exe: can't open file '<unprintable file name>': [Errno 2] No such file or directory
本帖最后由 lumber2388779 于 2017-2-15 10:53 编辑
错误提示是没有找到你要打开的文件
你检查下你的文件目录下有你需要的文件不
视频中的环境和文件都是齐全的,路径也是没问题才正确
|
|