coddingtonbear / python-myfitnesspal

Access your meal tracking data stored in MyFitnessPal programatically
MIT License
794 stars 138 forks source link

ValueError: Expecting value: line 1 column 1 (char 0) #71

Closed prabal97 closed 5 years ago

prabal97 commented 5 years ago

import myfitnesspal as mfp

client=mfp.Client('vaasitas') Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.4/dist-packages/myfitnesspal/client.py", line 52, in init self._login() File "/usr/local/lib/python3.4/dist-packages/myfitnesspal/client.py", line 105, in _login self._auth_data = self._get_auth_data() File "/usr/local/lib/python3.4/dist-packages/myfitnesspal/client.py", line 126, in _get_auth_data return result.json() File "/usr/local/lib/python3.4/dist-packages/requests/models.py", line 896, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib/python3.4/json/init.py", line 318, in loads return _default_decoder.decode(s) File "/usr/lib/python3.4/json/decoder.py", line 343, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode raise ValueError(errmsg("Expecting value", s, err.value)) from None ValueError: Expecting value: line 1 column 1 (char 0)

coddingtonbear commented 5 years ago

I'm not able to reproduce such a problem, @prabal97 --


In [1]: from myfitnesspal import Client

In [2]: c = Client('myusername')

In [3]: c.get_date(2018, 9, 25)
Out[3]: <09/25/18 {}>

In [4]:

But, from the traceback, it's clear that the problem is occurring when its trying to log-in. You may want to try making sure that the password you've saved for that account is correct.

prabal97 commented 5 years ago

Hey, thanks for the help, it's working now. though

import myfitnesspal as mfp

client=mfp.Client('chhibbar97') day=client.get_date(2018,9,25) Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.4/dist-packages/myfitnesspal/client.py", line 491, in get_date complete = self._get_completion(document) File "/usr/local/lib/python3.4/dist-packages/myfitnesspal/client.py", line 266, in _get_completion if "day_incomplete_message" in completion_message.classes: AttributeError: 'HtmlElement' object has no attribute 'classes'

coddingtonbear commented 5 years ago

Your most recent comment looks like it's a duplicate of #68; given that your original problem appears to be resolved, I think this specific issue can be closed.