|
@@ -1,11 +1,13 @@
|
|
|
"""
|
|
|
|
|
|
"""
|
|
|
+import platform
|
|
|
from abc import abstractmethod
|
|
|
|
|
|
import api
|
|
|
from playwright.sync_api import Playwright, sync_playwright
|
|
|
|
|
|
+SPLIT_CHAR = '\\' if platform.system() == 'Windows' else '/'
|
|
|
|
|
|
class BaseBrowser:
|
|
|
def __init__(self, phone: str, playwright=None):
|
|
@@ -23,7 +25,7 @@ class BaseBrowser:
|
|
|
self.sure_playwright()
|
|
|
self.browser = self.playwright.chromium.launch_persistent_context(
|
|
|
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,
|
|
|
slow_mo=1000,
|
|
|
channel="chrome",
|