How to use the Google Chrome (Incognito mode) with Extension/Add-ons? [Windows OS]

605 views
Skip to first unread message

Mika Salonga

unread,
Feb 17, 2016, 12:11:31 AM2/17/16
to Selenium Users
I want to used my extension in my google chrome (Incognito mode). Is there any good way? I don't want to download extension because I have already installed in my default browser. 

I have Python code but don't work:

import time, os
from selenium import webdriver
from selenium.webdriver.chrome.options import Options

executable_path
= "C:\chromedriver_win32\chromedriver"

chrome_options
= Options()

chrome_options
.add_argument("--incognito")
chrome_options
.add_argument(r"user-data-dir=C:\Users\Mika\AppData\Local\Google\Chrome\User Data")

driver
= webdriver.Chrome(executable_path=executable_path, chrome_options=chrome_options)

driver
.get("http://google.com") # This code is not working

time
.sleep(60)  # 60 seconds sleep/delay
driver
.quit()


Harsh S.

unread,
Feb 17, 2016, 7:15:18 AM2/17/16
to Selenium Users

Himanshu Dhamija

unread,
Feb 17, 2016, 9:03:17 AM2/17/16
to Selenium Users
Not Sure about how it can be done in Python but you might be able to achieve it using npm.

Reply all
Reply to author
Forward
0 new messages