自己留着看的 python

from DrissionPage import ChromiumPage
import time
from DrissionPage.easy_set import set_paths
from DrissionPage import ChromiumOptions
from DrissionPage.easy_set import set_headless, set_paths,use_auto_port
from DrissionPage.common import ActionChains

page = ChromiumPage()
ac = ActionChains(page)
page.get(‘https://www.99csw.com/’)

tes = str(page.ele(“.main-wrapper”).text)
time.sleep(5)
if tes != “” and “需要首先检查您的连接安全性” in tes:
print(“需要点击”)
try:
time.sleep(15)
iframe = page.get_frame(1)
iframe.ele(‘.ctp-label’).click()

except:
    print("再一次尝试")
    time.sleep(15)
    iframe = page.get_frame(1)
    iframe.ele('.ctp-label').click()

你可能感兴趣的:(python,前端)