liufuhua007

fixbug

......@@ -84,6 +84,8 @@ async def main():
await toutiao_setup(str(account_file), handle=True, auto=False)
elif args.platform == SOCIAL_MEDIA_BAIJIAHAO:
await toutiao_setup(str(account_file), handle=True, auto=False)
elif args.platform == SOCIAL_MEDIA_SOHU:
await sohu_setup(str(account_file), handle=True)
elif args.action == 'auto_login':
print(f"auto Logging in with account {args.account_name} on platform {args.platform}")
......
......@@ -25,9 +25,6 @@ async def toutiao_setup(account_file, handle=False, auto=False):
async def open_toutiao_main_page(account_file):
async with async_playwright() as playwright:
options = {
'args': [
'--lang en-GB'
],
'headless': False, # Set headless option here
}
# Make sure to run headed.
......@@ -82,9 +79,6 @@ async def get_toutiao_cookie(account_file):
print("get_toutiao_cookie")
async with async_playwright() as playwright:
options = {
'args': [
'--lang en-GB'
],
'headless': False, # Set headless option here
}
# Make sure to run headed.
......@@ -94,7 +88,7 @@ async def get_toutiao_cookie(account_file):
context = await set_init_script(context)
# Pause the page, and start recording manually.
page = await context.new_page()
await page.goto("https://mp.toutiao.com")
await page.goto("https://mp.toutiao.com", {waitUntil: "commit"})
# 手动授权登录
await page.pause()
......