网站停留时间 [英] Time from the site

查看:86
本文介绍了网站停留时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何下载网站时间?

<div class="fl_left">
<input type="button" name="m_text" class="timerButton" value="18"> ==$0
</div>

值< value>每隔几秒钟改变一次

The value <value> changes every few seconds

我尝试:

 Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
        For Each time As HtmlElement In WebBrowser1.Document.GetElementsByTagName("div")
            If time.GetAttribute("value") = "" Then
                Label6.Text = time.InnerText
            End If
        Next
    End Sub

但是它不起作用

推荐答案

由于值"属性属于< input> ;,因此不属于到< div> ;,您是否尝试搜索< input>元素使用 GetElementsByTagName 并分析属性?

Since "value" attribute belongs to <input>, not to <div>, have you tried to search for <input> elements using GetElementsByTagName and analyse the attributes?

也可以尝试 GetElementsByName("m_text"),获取第一个结果,然后提取值"属性.

Also try GetElementsByName("m_text"), get the first result, then extract the "value" attribute.

如果该值不是恒定值,则可以启动一个计时器(可以将其从工具箱"拖动到表单中),该计时器将定期提取该值.


这篇关于网站停留时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆