|
发表于 2017-10-24 17:05:44
|
显示全部楼层
按照上面的代码报错 请问大神这个报错怎么解决- C:\Users\wanglei\AppData\Local\Programs\Python\Python36-32\python.exe C:/Users/wanglei/PycharmProjects/untitled3/qweqweqw.py
- {'i': '翻译', 'from': 'AUTO', 'to': 'AUTO', 'smartresult': 'dict', 'client': 'fanyideskweb', 'salt': '1508835751366', 'sign': '2d8a8226fed4faef88d4b80f068582df', 'doctype': 'json', 'version': '2.1', 'keyfrom': 'fanyi.web', 'action': 'FY_BY_ENTER', 'typoResult': 'true'}
- Traceback (most recent call last):
- File "C:/Users/wanglei/PycharmProjects/untitled3/qweqweqw.py", line 34, in <module>
- youdaojson = requests.post(post_url,headers = headers,data=data).json()
- File "C:\Users\wanglei\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\models.py", line 892, in json
- return complexjson.loads(self.text, **kwargs)
- File "C:\Users\wanglei\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads
- return _default_decoder.decode(s)
- File "C:\Users\wanglei\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode
- obj, end = self.raw_decode(s, idx=_w(s, 0).end())
- File "C:\Users\wanglei\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 357, in raw_decode
- raise JSONDecodeError("Expecting value", s, err.value) from None
- json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- Process finished with exit code 1
复制代码 |
|