I'm trying to write a python script on windows platform to open a webpage(such as Google), and then, after 10 seconds, close this website.
Note: I'm using Windows 7, Python 2.7.10, and IE
I'm trying to write a python script on windows platform to open a webpage(such as Google), and then, after 10 seconds, close this website.
Note: I'm using Windows 7, Python 2.7.10, and IE
You can use pythons built in webbrowser module to open the default browser:
import webbrowser
webbrowser.open("http://google.co.uk")
https://docs.python.org/2/library/webbrowser.html
If you want more control of the browser (for example the ability to close the browser) you could investigate the use of Selenium, however I believe you have to be specific about what browser to open.
from selenium import webdriver
from time import sleepdriver = webdriver.Firefox()
driver.get("http://google.co.uk")
sleep(10)
driver.close()
http://selenium-python.readthedocs.org/en/latest/getting-started.html