Browse Source

fix: playwright bug

wuwenyi 8 months ago
parent
commit
213921afe7
1 changed files with 4 additions and 4 deletions
  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: []):
         """