1. 利用EditThisCookie插件获取页面cookie
2. 源码实例
"""set browser"""browser = await launch({"headless": False,"executablePath": "F:\\chrome-win32\\chrome.exe","args": ["--disable-gpu","--disable-web-security","--disable-xss-auditor", # 关闭 XSS Auditor"--no-sandbox","--disable-setuid-sandbox","--allow-running-insecure-content", # 允许不安全内容"--disable-webgl",],"ignoreHTTPSErrors": True # 忽略证书错误})width, height = screen_size()page = await browser.newPage()tasks = [# 设置UAasyncio.ensure_future(page.setUserAgent(random.choice(user_agents))),# 启用JS,不开的话无法执行JSasyncio.ensure_future(page.setJavaScriptEnabled(True)),# 关闭缓存asyncio.ensure_future(page.setCacheEnabled(False)),# 设置窗口大小asyncio.ensure_future(page.setViewport({"width": width, "height": height}))]await asyncio.wait(tasks)cookies = [{},{}]for item in cookies:await page.setCookie(item)"""Search"""url = ""await page.goto(url, {"waitUntil": "networkidle2", "timeout": 30000})