I am new in python, so bear with me. I have a python file which opens a new tab from the default browser every 30 mins for my personal issues. Now the thing is that It can get seriously annoying if it happens if it happens in-between my work schedule. So I would like it to happen silently in the background. I have heard about Selenium
which according to google is Python language bindings for Selenium WebDriver. The selenium package is used to automate web browser interaction from Python
. However when I sat down to learn a little more about this, it was all a bouncer. The python file I used to open the webbroswer is this:
def Ultra():
loop_value = 1
while loop_value==1:
try:
urllib2.urlopen("https://google.com")
except urllib2.URLError, e:
print "Network currently down."
sleep(20)
else:
print "Up and running."
loop_value = 0
webbrowser.open_new_tab('https://website.com')
Ultra()
The first part of the code Makes sure that net connection is present or not, if not it sleeps for 20 secs and tries again, if it is present then it opens website.com
through the default browser. Now if some one can help me, I would like the browser to be run in the background, because I don't even have the slightest hint as to where to start.
Thanks
Edit- I am using Windows