c#webbrowser.document.Innertext问题 [英] c# Problem with webbrowser.document.Innertext

查看:246
本文介绍了c#webbrowser.document.Innertext问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码。当浏览器第一次加载时,函数Function()被加载并且它找到变量,但是当浏览器第二次加载时,加载了funtion()但它没有找到变量但是我检查了html并且变量存在。有人知道为什么会这样吗?



I have the following code. When Browser loads first time, the function Function() is loaded and It finds "variable", but when the browser loads second time, funtion() is loaded but it doesnt find "variable" but I have checked the html and the variable exists. Anyone knows why is that?

  void Browser_DocumentCompleted(object sender, EventArgs e)
        {
Function();
}

Function()
{
            string document= Browser.Document.Body.InnerHtml;
            
            string regex1 = @"(?<=label:</td><td></td><td>)\d{2,3}";
            
            int variable= 0;
            double variable1= 0;
           
            foreach (Match zx in Regex.Matches(document, regex1))
            {

                variable= zx.Value;
               
                MessageBox.Show(variable);

            }
}

推荐答案

告诉我们你的客户端scirpts pls!
show us your client scirpts pls !


page - >右键单击 - >源代码
page --> right-click -->the source code


这篇关于c#webbrowser.document.Innertext问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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