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

Unexpected error while parsing data #161

Open
tyl3r opened this issue Feb 15, 2025 · 5 comments
Open

Unexpected error while parsing data #161

tyl3r opened this issue Feb 15, 2025 · 5 comments

Comments

@tyl3r
Copy link

tyl3r commented Feb 15, 2025

Unexpected error while parsing data for title 'The Girl with the Needle'

Fallo con Python 3.9, actualice a 3.13.2 y también falla:

Unexpected error while parsing data on page 'https://www.filmaffinity.com/en/userratings.php?user_id=XXX&p=1&orderby=rating-date&chv=list'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python313\Scripts\fa-scraper.exe\__main__.py", line 7, in <module>
    sys.exit(main())
             ~~~~^^
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python313\Lib\site-packages\fa_scraper\cli.py", line 78, in main
    save_to_csv(data, fieldnames, export_file)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python313\Lib\site-packages\fa_scraper\fa_scraper.py", line 285, in save_to_csv
    for d in dicts:
             ^^^^^
  File "C:\Users\XXX\AppData\Local\Programs\Python\Python313\Lib\site-packages\fa_scraper\fa_scraper.py", line 154, in get_profile_data
    title_type[0].find_all(class_="type")[0].string.strip(),
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

También he probado en español y mismo error.

@tyl3r
Copy link
Author

tyl3r commented Feb 15, 2025

Quitando la nota de 'The Girl with the Needle' parece funcionar y me muestra como pasa paginas hasta que se queda parado en 'Page 28' de un total de 67, en esta página se queda el cursor parpadeando y el archivo 'test.csv' ha guardado 1396 votaciones. Lo he dejado un buen rato y ya no guarda nada más.

@mx-psi
Copy link
Owner

mx-psi commented Feb 17, 2025

Hola, podrías confirmarme qué versión de fa-scraper estás ejecutando? Puedes hacerlo con fa-scraper --version

@tyl3r
Copy link
Author

tyl3r commented Feb 19, 2025

fa-scraper 0.4.1, puntua The Girl with the Needle (https://www.filmaffinity.com/es/film678742.html) y usa tu script para intentar descubrir el error.

El tema de que se pare en una página en concreto, en mi caso en la 28 de 67, ni idea, con suerte estará relacionado.

@mx-psi
Copy link
Owner

mx-psi commented Feb 20, 2025

Okay, le echaré un vistazo en las próximas semanas, gracias!

@pauguillen2
Copy link

Buenas, aquí tengo el mismo problema

fa-scraper --csv letterbox 909632 Unexpected`` error while parsing data for title 'A Stormy Night' Unexpected error while parsing data on page 'https://www.filmaffinity.com/en/userratings.php?user_id=909632&p=9&orderby=rating-date&chv=list' Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.13/bin/fa-scraper", line 8, in <module> sys.exit(main()) ~~~~^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fa_scraper/cli.py", line 78, in main save_to_csv(data, fieldnames, export_file) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fa_scraper/fa_scraper.py", line 285, in save_to_csv for d in dicts: ^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/fa_scraper/fa_scraper.py", line 154, in get_profile_data title_type[0].find_all(class_="type")[0].string.strip(), ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of range

Gracias

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