|
@@ -1,11 +1,13 @@
|
|
"""
|
|
"""
|
|
|
|
|
|
"""
|
|
"""
|
|
|
|
+import platform
|
|
from abc import abstractmethod
|
|
from abc import abstractmethod
|
|
|
|
|
|
import api
|
|
import api
|
|
from playwright.sync_api import Playwright, sync_playwright
|
|
from playwright.sync_api import Playwright, sync_playwright
|
|
|
|
|
|
|
|
+SPLIT_CHAR = '\\' if platform.system() == 'Windows' else '/'
|
|
|
|
|
|
class BaseBrowser:
|
|
class BaseBrowser:
|
|
def __init__(self, phone: str, playwright=None):
|
|
def __init__(self, phone: str, playwright=None):
|
|
@@ -23,7 +25,7 @@ class BaseBrowser:
|
|
self.sure_playwright()
|
|
self.sure_playwright()
|
|
self.browser = self.playwright.chromium.launch_persistent_context(
|
|
self.browser = self.playwright.chromium.launch_persistent_context(
|
|
proxy=None,
|
|
proxy=None,
|
|
- user_data_dir=f'./.data/{self.__get_name__()}/{self.phone}',
|
|
|
|
|
|
+ user_data_dir=f'.{SPLIT_CHAR}.data{SPLIT_CHAR}{self.__get_name__()}{SPLIT_CHAR}{self.phone}',
|
|
headless=False,
|
|
headless=False,
|
|
slow_mo=1000,
|
|
slow_mo=1000,
|
|
channel="chrome",
|
|
channel="chrome",
|