You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am developing a super simple webapp to better follow up my metrics and I found out this error when running the example in your documentation.
client.get_food_search_results("bacon cheeseburger")
IndexError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_38820\648193376.py in <module>
----> 1 client.get_food_search_results("bacon cheeseburger")
~\anaconda3\lib\site-packages\myfitnesspal\client.py in get_food_search_results(self, query)
778 "(//input[@name='authenticity_token']/@value)[1]"
779 )[0]
--> 780 utf8_field = document.xpath("(//input[@name='utf8']/@value)[1]")[0]
781
782 result = self.session.post(
IndexError: list index out of range
Any suggestion for this error?
The text was updated successfully, but these errors were encountered:
Thanks John! Looks like the referenced element ('utf8') no longer exists in this page, and the search request (https://www.myfitnesspal.com/food/search) no longer expects it. It appears to be safe to remove. See PR #159
import myfitnesspal
import browser_cookie3
client = myfitnesspal.Client(browser_cookie3.safari())
food_items = client.get_food_search_results("bacon cheeseburger")
Traceback (most recent call last):
File "/Users/.../PycharmProjects/Strength/datakitchensink.py", line 11, in <module>
food_items = client.get_food_search_results("bacon cheeseburger")
File "/usr/local/lib/python3.9/site-packages/myfitnesspal/client.py", line 780, in get_food_search_results
utf8_field = document.xpath("(//input[@name='utf8']/@value)[1]")[0]
IndexError: list index out of range
Hi team,
I am developing a super simple webapp to better follow up my metrics and I found out this error when running the example in your documentation.
Any suggestion for this error?
The text was updated successfully, but these errors were encountered: