How to refresh a browser tap after time.sleep in python
Question: So this is what I'm using to open the browser

    
    
    import webbrowser
    import time
    
    url = "http://google.com"
    time = 5
    
    def TestBrowse(url,time):
        webbrowser.open(url)
        time.sleep(time)
    

I want a function or method following time.sleep that will refresh the tab
that the function opens. This is a module I'm just getting familiar with so I
don't even know if its a better module or solution for this (or if at all
possible)

Infact my main target was to be able to close the tab but I've been reading
there is no way to do that, If this is false I would also love knowing how to
do that. I've experimented with using os.system to kill the browser but
os.system never seems to work inside a function (and It doesn't seem like a
good idea anyway)


Answer: Maybe using [selenium](http://docs.seleniumhq.org/) would be a better option
for browser programing. It accepts python scripts.

Also, you could try creating a wrapper web page with an embedded script that
does the refreshing and/or exiting, though the browser might threat it as a
cross-site scripting and limit the functionality of the URL you are trying to
access. In any case to use that you would need to program in javascript rather
than python.

