I have an XML file that is updated every 5 minutes (data.xml). I also have a Flask Webserver (app.py) running on the same platform. This webserver hosts a HTML5 page (index.html). What is the most efficient way of displaying information from the XML page on the HTML (index.html) page in set locations and having it update every 5 minutes and when the page is refreshed? I have been advised to look at AJAX and jQuery but as I have no experience with these they seem slightly confusing. I need some help to find the most effecient solution. Fairly new to programming. Thank you in advance.
Data.xml:
<?xml version='1.0' encoding='utf-8'?>
<root>
<coin>
<trader variable="GLDAG_MAPLE">Gold.co.uk</trader>
<metal>Silver</metal>
<type>Maple</type>
<price>£31.2</price>
</coin>
</root>
Data2.xml: data.xml converted to a dictionary
<root><coin><trader variable="GLDAG_MAPLE">Gold.co.uk</trader><metal>Silver</metal><type>Maple</type><price>£31.56</price></coin><coin><trader variable="GLDAG_BRITANNIA">Gold.co.uk</trader><metal>Silver</metal><type>Britannia</type><price>£32.4</price></coin><coin><trader variable="GLDAG_PHILHARMONIC">Gold.co.uk</trader><metal>Silver</metal><type>Philharmonic</type><price>£32.76</price></coin><coin><trader variable="BBPAG_MAPLE">Bullion By Post</trader><metal>Silver</metal><type>Maple</type><price>£27.12</price></coin><coin><trader variable="BBPAG_BRITANNIA">Bullion By Post</trader><metal>Silver</metal><type>Britannia</type><price>£23.88</price></coin><coin><trader variable="BBPAG_PHILHARMONIC">Bullion By Post</trader><metal>Silver</metal><type>Philharmonic</type><price>£26.88</price></coin></root>
App.py:
from flask import Flask, flash, redirect, render_template, request, session, abort, url_for
app = Flask(__name__)
# ./Home Script + Portfolio Page:
@app.route("/")
@app.route("/index")
def index():
return render_template('index.html')
Index.html:
<td> Price from XML file needs to be presented here! </td>