wangkun 1 year ago
parent
commit
0ba3f41079
1 changed files with 2 additions and 1 deletions
  1. 2 1
      shipinhao/shipinhao_search/shipinhao_search.py

+ 2 - 1
shipinhao/shipinhao_search/shipinhao_search.py

@@ -245,10 +245,11 @@ class ShipinhaoSearch:
         webviews = driver.contexts
         Common.logger(log_type, crawler).info(f"webviews:{webviews}")
         driver.switch_to.context(webviews[1])
-        time.sleep(1)
+        time.sleep(3)
         windowHandles = driver.window_handles
         for handle in windowHandles:
             driver.switch_to.window(handle)
+            time.sleep(3)
             if driver.find_element(By.XPATH, '//div[@class="unit"]'):
                 Common.logger(log_type, crawler).info('切换 webview 成功')
                 return "成功"