Explorar el Código

MOD:创建落地页

cxyu hace 3 años
padre
commit
4ca0dd3e1d
Se han modificado 1 ficheros con 4 adiciones y 2 borrados
  1. 4 2
      wechat_action/create_ad_layout.py

+ 4 - 2
wechat_action/create_ad_layout.py

@@ -29,9 +29,11 @@ class CreateAd:
             # 落地页内容有的账户有,有的无,无的默认等5s
             WebDriverWait(self.driver, 5).until(lambda driver: len(self.driver.find_elements_by_xpath(
                 '//*[@class="adui-table-tr"]')))
-            print( len(self.driver.find_elements_by_xpath(
+            print(len(self.driver.find_elements_by_xpath(
                 '//*[@class="adui-table-tr"]')))
-        except:
+        except Exception as e:
+            logging.error(str(e))
+            time.sleep(5)
             pass
         WebDriverWait(self.driver, 10).until(lambda driver: self.driver.find_element_by_xpath(
             '//*[@class="ui-fl-r adui-button-base adui-button-primary adui-button-small"]'))