Python update HTML document

I have an HTML document that I can open with the webbrowser module, specifying it as the URL I want to open, this works fine. I want this document to be able to update itself (in a different way than reopening it) with the Python script that will be run. I tried setting new = 0 in the webbrowser module, but in any case it just opens a new tab in the browser. Is there any way to do this?

+5
source share
2 answers

Javascript:

setInterval(function(){ $.getJSON("/Command",function(data){ if(data.Refresh==1){ $('body').load('THE URL OF PAGE') ;// or location.reload(); } }); },1000);

/Command Controlled by python to tell the browser what to do.

0
source

use js without python.use js without python.use js without python.use js without python.use js without python.

0
source

All Articles