-
-
Save vijaypurohit/143582c0b225d74d9e7367708524e724 to your computer and use it in GitHub Desktop.
This code is used to open link in
incognito mode of browser and then close.
this is repeat for certain amount of time
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import webbrowser | |
import os | |
'''give value you want to open url''' | |
a = 30 | |
'''enter the url is here''' | |
url = 'https://stackoverflow.com/questions/37769148/how-to-open-chrome-in-incognito-mode-from-python' | |
'''this path of chrome is defult change if your chrome path other ''' | |
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s --incognito' | |
'''here is while loop''' | |
while a > 0: | |
webbrowser.get(chrome_path).open_new(url) #for open url | |
print('browser is opened') | |
time.sleep(10) #time sleep is also in second | |
os.system("taskkill /f /im chrome.exe") | |
a = a-1 | |
print(a,'time is left') | |
'''this program work for www, http and https''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment