aguerradelgado / goodreads_webscraper_2

0 stars 0 forks source link

download csv script no longer working #25

Closed aguerradelgado closed 1 year ago

aguerradelgado commented 1 year ago

image

script above is only getting the first book added to the tbr cart, despite the tbr cart having several. print in python showing all added books. was working before, cant identify what might have changed

jsgreenwell commented 1 year ago

your using |safe which tells jinja to safe (filter) results and add html tags raw (so bold becomes <b>bold</b>). This means it is taking it as a string not a list. If you are passing a list use {{ tbr | tojson }} as using tojson sets up both safe rendering and processes a list as a list (in this case changes a Python list to a JavaScript JSON list).

Secondary note, didn't get to go into MVC and other ways of building this due to time, you should have a secondary python script called view.py which handles rendering views then just import and call it in app.py as there are a lot of overlapping changes in your commits (simply because all the code is in one place) which would cause more problems down the road.

aguerradelgado commented 1 year ago

thank you, I changed that, and am still having the same issue. It is strange because the list is being appended too correctly, Here is the tbr cart: image

here it is printed in console image

here is what shows when download csv image

and here is the changed code image

I am having a hard time wrapping my head around this because it is working for grace right now with tbr | safe, and it had worked with that before, but not anymore.