rinalLi

u

......@@ -25,7 +25,6 @@ async def read_cookies_from_file(file_path):
return []
async def cookie_auth(account_file):
print(account_file)
async with async_playwright() as playwright:
browser = await playwright.chromium.launch(headless=True)
# context = await browser.new_context(storage_state=account_file)
......@@ -35,7 +34,6 @@ async def cookie_auth(account_file):
await context.add_cookies(saved_cookies)
await page.goto("https://www.xiaohongshu.com")
try:
print(await page.title())
await page.wait_for_selector("div.link-wrapper a.link-wrapper span.channel", timeout=5000) # 等待5秒
xhs_logger.success("[+] cookie 有效")
return True
......@@ -128,7 +126,7 @@ class XHSVideo(object):
xhs_logger.info("正在填充标题和话题...")
await page.locator("div.titleInput div div input").fill("花花")
await page.locator("div.titleInput div div input").fill(self.title)
inputTag = page.locator('id=quillEditor').locator('div p')
await inputTag.click()
......