Open johnhillescobar opened 1 year ago
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
Hi, I still get an IndexError with 2.0.1:
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?