yellowtail
V2EX  ›  问与答

Python 调试相关问题求助,感谢。。。

  •  
  •   yellowtail · Oct 30, 2019 · 1327 views
    This topic created in 2400 days ago, the information mentioned may be changed or developed.

    try: while (driver.find_element_by_xpath("/html/body/div[2]/div/div/div/div/button").text) == "点击按钮进行验证": print("当前需要验证码",time.time()) time.sleep(10) except NoSuchElementException as e: print("except",e)

    程序运行报错的内容是 Nosuchlelementexception 但是最后还是提示 name 'NoSuchElementException' is not defined

    求解惑。。。

    1 replies    2020-02-27 10:46:47 +08:00
    yellowtail
        1
    yellowtail  
    OP
       Feb 27, 2020
    网速没程序运行快,应该是因为检测元素时元素未下载
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3632 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 04:45 · PVG 12:45 · LAX 21:45 · JFK 00:45
    ♥ Do have faith in what you're doing.