热门
最新
红包
立Flag
投票
同城
我的
发布
这个关于C声明和定义的介绍太好了
extern——关键字
https://www.cnblogs.com/lanhaicode/p/10686688.html
https://www.cnblogs.com/lanhaicode/p/10633125.html
CSDN App 扫码分享
评论
点赞
打赏
- 复制链接
- 举报
下一条:
问题描述:post方法爬取 有道翻译 url = 'http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule'1请求数据 form_data = {'i': '我是谁', 'from': 'AUTO', 'to': 'AUTO', 'smartresult': 'dict', 'client': 'fanyideskweb', 'version': '2.1', 'keyfrom': 'fanyi.web', 'action': 'FY_BY_REALTlME', 'salt': '16093795371134', 'sign': '529001bd3da4614ad852e15d06204083', 'lts': '1609379537113', 'bv': '4f7ca50d9eda878f3f40fb696cce4d6d', 'doctype': 'json'}1234请求 response = requests.post(url, form_data, 'json')1将json格式字符串转字典 content = json.loads(response.text)1打印翻译的相应内容 print(content)1获取结果 print('翻译结果:' + content['translateResult'][0][0]['tgt'])1在进行删除上面请求的时候,返回errorCode:50的错误,有点懵逼,最后发现请求后面有_o,删除之后,请求正常。在此记录一下! url = 'http://fanyi.youdao.com/translate_o?smartresult=dict&smartresult=rule' 改为 url = 'http://fanyi.youdao.com/translate?smartresult=dict&smartresult=rule' ————————————————版权声明:本文为CSDN博主「Tony-devj」的原创文章原文链接:https://blog.csdn.net/qian1314520hu/article/details/112003476