Greetings,
i'm trying to parse HTML website and present same basic info about it. I'm using BeuatifulSoup4 and Python3. Code is simple, but i have problem to force Django template show variables in my list. For example this simple code in template:
{{ tags_hx }}
<h1>Tags H1 - H7</h1>
<table class="table-striped table table-hover">
{% for tag in tags_hx %}
<tr>
<td>{% autoescape off %}{{ tag|safe }}{% endautoescape %}</td>
</tr>
{% endfor %}
</table>
while {{ tags_hx }} prints lists exactly i have:
[<h1 style="text-align: center"><span style="color: rgb(178, 34, 34);">Beginners English Tests 1</span></h1>, <h3>Grammar</h3>, <h3>Beginners ESL</h3>, <h3>For Kids</h3>, <h3>Reading Skills</h3>, <h3>Major Exams</h3>, <h3>Writing & Vocab</h3>]
but i can't get or force Django template to show each tag in table. All i get is:
Tags H1 - H7
[Beginners English Tests 1]
[]
[]
[]
[]
[]
[]
I know, when i insert html code in template it will be used by browser, but just makes me mad i can't get to work it :) Autoescape or |safe doesn't help. Please, can you help me how to force simple output tags in cycle regardless of the consequences?
Thanks!