加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

等待.5秒后再继续VB.net

发布时间:2020-12-17 00:17:46 所属栏目:大数据 来源:网络整理
导读:我有一个代码,我希望它等到中间的某个地方,然后再继续前进. 在WebBrowser1.Document.Window.DomWindow.execscript(“checkPasswordConfirm();”,“ JavaScript”)之后 我想要等待.5秒,然后做其余的代码. WebBrowser1.Document.Window.DomWindow.execscript("
我有一个代码,我希望它等到中间的某个地方,然后再继续前进.
在WebBrowser1.Document.Window.DomWindow.execscript(“checkPasswordConfirm();”,“ JavaScript”)之后
我想要等待.5秒,然后做其余的代码.
WebBrowser1.Document.Window.DomWindow.execscript("checkPasswordConfirm();","JavaScript")

    Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
    For Each webpageelement As HtmlElement In allelements
        If webpageelement.InnerText = "Sign Up" Then
            webpageelement.InvokeMember("click")
        End If
    Next
您将需要使用 System.Threading.Thread.Sleep(number of milliseconds).
WebBrowser1.Document.Window.DomWindow.execscript("checkPasswordConfirm();","JavaScript")

Threading.Thread.Sleep(500) ' 500 milliseconds = 0.5 seconds

Dim allelements As HtmlElementCollection = WebBrowser1.Document.All
For Each webpageelement As HtmlElement In allelements
    If webpageelement.InnerText = "Sign Up" Then
        webpageelement.InvokeMember("click")
    End If
Next

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读