Python Forum
Flask, read H5 text value - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Flask, read H5 text value (/thread-38559.html)



Flask, read H5 text value - tantony - Oct-28-2022

I'm writing a Flask grocery list app.

How would I get the text value of H5 tag? So I can delete or modify it?

Screenshot: Screenshot from Raspberry Pi

So I'm making each item in the list a H5 HTML tag, but let's say I want to access 'banana 2 set', how do I do that?

{% for item in items %}
     <h5 align="center"> {{ items[1] }} </h5>
{% endfor %}



RE: Flask, read H5 text value - tantony - Oct-28-2022

I assume I also have to do some javascript such as may be mouse hover so when I move the mouse over the item in the list, it'll select that?

All the online examples I've seen with Flask are using forms, but I didn't see any examples with H1-5 tags, list etc.


RE: Flask, read H5 text value - tantony - Oct-31-2022

Anyone?


RE: Flask, read H5 text value - Larz60+ - Oct-31-2022

I haven't used flask in a while, so can only post sites related to your question, this is not a recommendation, but hopefully useful:
https://9to5answer.com/getting-value-from-select-tag-using-flask


RE: Flask, read H5 text value - tantony - Oct-31-2022

Thank you, all the ones I could find, and including the one you posted are using a form. I don't have a form.
I guess I'll have to use the form tag.