From 37f71e3a16fd1359613946950de1d2c92054b33d Mon Sep 17 00:00:00 2001 From: work Date: Wed, 8 Apr 2026 10:23:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=B4=A6=E5=8F=B7=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E4=BD=BF=E7=94=A8=E4=BB=A3=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- spider/task.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/spider/task.py b/spider/task.py index 9729bc3..7f2e3de 100644 --- a/spider/task.py +++ b/spider/task.py @@ -644,8 +644,17 @@ def playwright_get_user_profile(cookies, username=None): with login_semaphore: with sync_playwright() as playwright: update_windows_distinguish() + username = 'moremore_51WM1' + password = 'TOv5y0nXCZH_JH+5' + country = 'US' + browser = playwright.chromium.launch( - headless=const.HEADLESS, args=['--start-maximized'], executable_path=path + headless=const.HEADLESS, args=['--start-maximized'], executable_path=path, + proxy={ + "server": "http://pr.oxylabs.io:7777", # 必填 + "username": f"customer-{username}-cc-{country}", + "password": password + } ) context = browser.new_context(no_viewport=True) context.add_cookies(parse_cookies(cookies)) @@ -1045,8 +1054,17 @@ def playwright_m_login(username, password, code_2fa=None): # raise OperationFailed("获取代理失败") # logger.info(f"使用proxy={proxy_url}") + username = 'moremore_51WM1' + password = 'TOv5y0nXCZH_JH+5' + country = 'US' + browser = playwright.chromium.launch( - headless=const.HEADLESS, args=['--start-maximized'], executable_path=path + headless=const.HEADLESS, args=['--start-maximized'], executable_path=path, + proxy={ + "server": "http://pr.oxylabs.io:7777", # 必填 + "username": f"customer-{username}-cc-{country}", + "password": password + } ) # random_user_agent = UserAgent().getBrowser(["Chrome Mobile iOS"]).get("useragent") random_user_agent = "Mozilla/5.0 (Linux; Android 12; Pixel 6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.41 Mobile Safari/537.36"