rinalLi

u

......@@ -49,7 +49,7 @@ async def get_sohu_cookie(account_file):
'args': [
'--lang en-GB'
],
'headless': True, # Set headless option here
'headless': False, # Set headless option here
}
# Make sure to run headed.
browser = await playwright.chromium.launch(**options)
......@@ -63,9 +63,14 @@ async def get_sohu_cookie(account_file):
except:
pass
await asyncio.sleep(1)
await page.wait_for_selector("div.user-ico", timeout=50000)
await page.locator("div.hd-login-logo span").nth(1).click()
try:
await page.wait_for_selector("a.hd-fBtn-userlogin img", timeout=100000)
except:
sohu_logger.info("登录超时")
return
sohu_logger.info("搜狐视频登录成功")
await asyncio.sleep(3)
await asyncio.sleep(1)
# await page.pause()
# 点击调试器的继续,保存cookie
......