|
@@ -19,17 +19,23 @@ class JBrowser:
|
|
|
os.chdir("C:\\Program Files\\Google\\Chrome\\Application\\")
|
|
|
home = expanduser("~")
|
|
|
print(home)
|
|
|
-# config = configparser.ConfigParser()
|
|
|
-# config.read_file(open('defaults.cfg'))
|
|
|
-# config.read(['site.cfg', os.path.expanduser('~/.myapp.cfg')],
|
|
|
-# encoding='cp1250')
|
|
|
+ config = configparser.ConfigParser()
|
|
|
+ content=config.read_file(open(home+'\\test.cfg'))
|
|
|
+ print(content)
|
|
|
+ print(config['DEFAULT'])
|
|
|
+ print(config.sections())
|
|
|
+ self.userdir=config['DEFAULT'].get('userdir')
|
|
|
+
|
|
|
|
|
|
def set_profile_path(self,profilepath):
|
|
|
self.profilepath=profilepath
|
|
|
option = webdriver.ChromeOptions()
|
|
|
option.add_argument('--disable-web-security')
|
|
|
option.add_argument('--allow-running-insecure-content')
|
|
|
- option.add_argument("--user-data-dir=C:\\Users\\jared\\AppData\\Local\\Google\\Chrome\\User Data\\"+self.profilepath+"\\")
|
|
|
+
|
|
|
+ option.add_argument("--user-data-dir="+self.userdir+profilepath+"\\")
|
|
|
+
|
|
|
+# option.add_argument("--user-data-dir=C:\\Users\\jared\\AppData\\Local\\Google\\Chrome\\User Data\\"+self.profilepath+"\\")
|
|
|
self.option=option
|
|
|
driver = webdriver.Chrome(options=option)
|
|
|
self.driver=driver
|