Abdullah Md
Abdullah Md

Reputation: 151

Print python xml response into HTML page

My .py app return xml response from API, I want to write value of messageKey 'notFound' into the .html page.

Ex of response:

<response>
<returncode>FAILED</returncode>
<messageKey>notFound</messageKey>
<message>We could not find a meeting with that meeting ID</message>
</response>

EX of .html:

#....
<div class="row">
   <p id="demo"></p>
</div>
#....

Any kind of help please?

Upvotes: 0

Views: 68

Answers (1)

Abdullah Md
Abdullah Md

Reputation: 151

I solve this by:

.py:

@flask.route('/admin')
def index():
    return render_template("admin.html", variable=soup)

.html:

<div class="row">
  <p>{{variable}}</p>
</div>

Upvotes: 1

Related Questions