瀏覽代碼

fix: playwright bug

wuwenyi 11 月之前
父節點
當前提交
213921afe7
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      xhs/__init__.py

+ 4 - 4
xhs/__init__.py

@@ -52,10 +52,10 @@ class XhsBrowser(BaseBrowser):
         return xhs_client_obj
 
     def login(self):
-        with sync_playwright() as playwright:
-            self.__init_browser__()
-            # 暂时采用手动登录
-            self.page.wait_for_timeout(60_000)
+        self.__init_browser__()
+        # 暂时采用手动登录
+        self.page.wait_for_timeout(60_000)
+        self.playwright.stop()
 
     def polish_huitun_note(self, huitun_notes: []):
         """