fa-scraper icon indicating copy to clipboard operation
fa-scraper copied to clipboard

Unexpected error while parsing data

Open tyl3r opened this issue 11 months ago • 6 comments

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 avatar Feb 15 '25 11:02 tyl3r

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.

tyl3r avatar Feb 15 '25 12:02 tyl3r

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

mx-psi avatar Feb 17 '25 10:02 mx-psi

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.

tyl3r avatar Feb 19 '25 18:02 tyl3r

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

mx-psi avatar Feb 20 '25 10:02 mx-psi

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

pauguillen2 avatar Feb 21 '25 15:02 pauguillen2

Hola. Otro fallo similar, por si ayuda. Se para siempre en esta película, en la cuarta página de 31 en total. Probado tanto en español como en inglés con el mismo resultado.

fa-scraper 0.4.1 ejecutado en entorno virtual python 3.13

Un saludo y muchas gracias.

Unexpected error while parsing data for title 'Last and First Men'
Unexpected error while parsing data on page 'https://www.filmaffinity.com/es/userratings.php?user_id=650011&p=4&orderby=rating-date&chv=list'
Traceback (most recent call last):
  File "/home/xxx/mienv/bin/fa-scraper", line 8, in <module>
    sys.exit(main())
             ~~~~^^
  File "/home/xxx/mienv/lib/python3.13/site-packages/fa_scraper/cli.py", line 78, in main
    save_to_csv(data, fieldnames, export_file)
    ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/xxx/mienv/lib/python3.13/site-packages/fa_scraper/fa_scraper.py", line 285, in save_to_csv
    for d in dicts:
             ^^^^^
  File "/home/xxx/mienv/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

chungalitos avatar Apr 12 '25 08:04 chungalitos