Use a different profile for mobile browser
This commit is contained in:
parent
3eb193eca3
commit
449d2da410
3
V6.py
3
V6.py
@ -9,7 +9,6 @@ from modules.db import add_to_database
|
|||||||
from modules.driver_tools import *
|
from modules.driver_tools import *
|
||||||
from modules.error import *
|
from modules.error import *
|
||||||
|
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
|
||||||
|
|
||||||
# create a webdriver
|
# create a webdriver
|
||||||
def create_driver(mobile=False):
|
def create_driver(mobile=False):
|
||||||
@ -24,7 +23,7 @@ def create_driver(mobile=False):
|
|||||||
"Chrome/22 Mobile Safari/537.36"
|
"Chrome/22 Mobile Safari/537.36"
|
||||||
)
|
)
|
||||||
|
|
||||||
chrome_profile_dir = init_profile(config.UserCredentials.get_mail())
|
chrome_profile_dir = init_profile(config.UserCredentials.get_mail(), mobile=mobile)
|
||||||
|
|
||||||
# Full list on https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
|
# Full list on https://github.com/GoogleChrome/chrome-launcher/blob/main/docs/chrome-flags-for-tools.md
|
||||||
arguments = [
|
arguments = [
|
||||||
|
@ -12,8 +12,12 @@ from modules.Tools.logger import debug
|
|||||||
from modules.Tools.tools import *
|
from modules.Tools.tools import *
|
||||||
|
|
||||||
|
|
||||||
def init_profile(mail):
|
def init_profile(mail, mobile=False):
|
||||||
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/"+mail
|
if not mobile:
|
||||||
|
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/"+mail
|
||||||
|
else:
|
||||||
|
chrome_profile_dir = "/app/MsRewards-Reborn/user_data/profile/mobile-"+mail
|
||||||
|
|
||||||
os.makedirs(chrome_profile_dir, exist_ok=True)
|
os.makedirs(chrome_profile_dir, exist_ok=True)
|
||||||
|
|
||||||
preferences_file = os.path.join(chrome_profile_dir, "Default", "Preferences")
|
preferences_file = os.path.join(chrome_profile_dir, "Default", "Preferences")
|
||||||
|
Loading…
Reference in New Issue
Block a user