1

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

  • 2
    possible duplicate with https://stackoverflow.com/questions/16180428/can-selenium-webdriver-open-browser-windows-silently-in-background .Check this link, your question may has been answered here. – coder Sep 18 '16 at 12:17
  • @coder Thanks, can this work with chrome too? – Hellfire Charchit Pb Sep 18 '16 at 13:03
  • 1
    Unfortunately, I haven't tried it, though this: https://stackoverflow.com/questions/18702533/how-to-execute-selenium-chrome-webdriver-in-silent-mode may be of some help! If you don't find enough info there, then maybe you should re-edit the title of your question so that it can be more chrome specific and likely someone with prior knowledge and experience will answer it! – coder Sep 18 '16 at 13:23
  • 1
    Linux, Mac, Windows? – Jacob Vlijm Sep 18 '16 at 13:35
  • @JacobVlijm Windows – Hellfire Charchit Pb Sep 18 '16 at 13:48

0 Answers0