Closed rbelzile closed 6 years ago
That's exactly what it's related to. I have the same issue.
In addition, when fixing this so that if 'N/A' in column.text store as None, I discovered that Fitbit calorie adjustments show up with a blank name. They have two a tags in the td.
`
<div class="exercise-description">
<a onclick="showAdjustmentInfo(); return false;" href="#">
Fitbit calorie adjustment
</a>
</div>
<a onclick="showAdjustmentInfo );" style="cursor: pointer;">
<img alt="Ic_i" src="http://d34yn14tavczy0.cloudfront.net/assets/ic_i-5a18e414bbf2a80fbfa2bed9c28c79c7.png">
</a>
</td>`
The if statement for grabbing the name returns the non nested a tag which is empty.
if columns[0].find('a') is None or not columns[0].find('a').text.strip():
^ That seems to fix it. I'll try to put in a PR soon with this fix.
I am having this same issue. Any chance for a fix?
I make a PR and it got merged. But yesterday I had the same issue again. I installed from source instead of pip install MyFitnessPal and it worked. Try doing a pip install git+https://GitHub.com/Coddingtonbear/Python-myfitnesspal.git
Done, that fixed it. Thanks.
No problem. I guess the pip version is stale?
Ahh; hrm -- sorry about that; I'll push out a new release later today!
Released @jgissend10's fix as part of 1.11.0; sorry for the delay!
When I attempt to use the get_exercise code, I get the following error.
I believe it's related to the fact that my iPhone syncs my step data in and returns N/A for minutes, which means that the re.sub... in _get_numeric is returning an empty string to int()
I can fix this, but I already have a pull request open and I'm unsure semantically if it makes more sense to check in _get_numeric and return 0 for blank strings or whether the get_exercise should be parsing for entirely non-numeric content before calling _get_numeric