wangkun 1 年之前
父节点
当前提交
0ba3f41079
共有 1 个文件被更改,包括 2 次插入1 次删除
  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 "成功"