Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception has occurred: IndexError list index out of range #156

Open
quangvv9Life opened this issue Apr 29, 2023 · 2 comments
Open

Exception has occurred: IndexError list index out of range #156

quangvv9Life opened this issue Apr 29, 2023 · 2 comments

Comments

@quangvv9Life
Copy link

quangvv9Life commented Apr 29, 2023

Hi guys,

Recently, i have been tested out this package and got this error which i guess might be a new security mechanism from myfitnesspal :

Exception has occurred: IndexError       (note: full exception trace is shown but execution is paused at: _run_module_as_main)
list index out of range
  File "G:\0_9Health\6_data\python-myfitnesspal\.venv\Lib\site-packages\myfitnesspal-2.0.1-py3.10.egg\myfitnesspal\client.py", line 780, in get_food_search_results
    utf8_field = document.xpath("(//input[@name='utf8']/@value)[1]")[0]
  File "G:\0_9Health\6_data\python-myfitnesspal\src\search-foods.py", line 32, in <module>
    food_items = client.get_food_search_results(ingredient_name)
  File "C:\Users\9Health\.pyenv\pyenv-win\versions\3.10.6\Lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\9Health\.pyenv\pyenv-win\versions\3.10.6\Lib\runpy.py", line 196, in _run_module_as_main (Current frame)
    return _run_code(code, main_globals, None,
IndexError: list index out of range

here is my code :

...
ingredient_name = "Champ - Gourami Fish"
food_items = client.get_food_search_results(ingredient_name)

does you guys have the same problem as mine ?

@quangvv9Life quangvv9Life changed the title Failed to decrypt the cipher text with DPAPI Exception has occurred: IndexError list index out of range Apr 29, 2023
@realPrimoh
Copy link

On line 780 of get_food_search_results in clent.py, replace 'utf8' with 'search'.

@hannahburkhardt
Copy link
Collaborator

Thanks @quangvv9Life and @realPrimoh - I fixed the issue in #159. Let me know if that fix does not fix the issue for you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants