diff --git a/spider/task.py b/spider/task.py index 9283ae0..520334a 100644 --- a/spider/task.py +++ b/spider/task.py @@ -1212,9 +1212,19 @@ def playwright_share(cookies, target_url, content): with sync_playwright() as playwright: update_windows_distinguish() + username = 'moremore_51WM1' + password = 'TOv5y0nXCZH_JH+5' + country = 'US' + browser = playwright.chromium.launch( - headless=False, args=['--start-maximized'], executable_path=path + headless=False, 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)) page = context.new_page()