Refresh a local web page using Python
The LivePage extension for Chrome. You can write to a file, then LivePage will monitor it for you. You can also optionally refresh on imported content like CSS. Chrome will require that you grant permissions on local file:// urls.
(I'm unaffiliated with the project.)
I'm using Python to gather some information, construct a very simple html page, save it locally and display the page in my browser using webbrowser.open('file:///c:/testfile.html'). I check for new information every minute. If the information changes, I rewrite the local html file and would like to reload the displayed page.
The problem is that webbrowser.open opens a new tab in my browser every time I run it.  How do I refresh the page rather than reopen it?  I tried new=0, new=1 and new=2, but all do the same thing. Using controller() doesn't work any better.
I suppose I could add something like < META HTTP-EQUIV="refresh" CONTENT="60" > to the < head > section of the html page to trigger a refresh every minute whether or not the content changed, but would prefer finding a better way.
Exact time interval is not important.
Python 2.7.2, chrome 26.0.1410.64 m, Windows 7 64.