使用网络浏览器在 InnerHtml 文件中搜索某些字符串

本文关键字:搜索 字符串 文件 InnerHtml 网络 浏览器 | 更新日期: 2023-09-27 18:33:35

我是 c# 的初学者,我似乎无法从网站上废弃 innerHtml。该网站是一个票务管理系统,通过ID输入工单。输入 ID 后,我希望在 Windows 表单应用程序文本框中显示一些信息:票证标题、创建位置等。

到目前为止,我使用网络浏览器登录网站,然后我想在文本框中输入票证 ID,按下生成按钮后,我想将工单标题显示在文本框中。

这是我的代码:对于"登录"按钮

this.webBrowser1.Navigate("https://elvis.harman.com/");
            while (this.webBrowser1.ReadyState != WebBrowserReadyState.Complete)
            {
                Thread.Sleep(100);
                Application.DoEvents();
            }
            //textBox1.Text= this.webBrowser1.Document.Window.Frames[2].Document.GetElementsByTagName("input").Count.ToString();

            this.webBrowser1.Document.Window.Frames[2].Document.GetElementsByTagName("input")[0].InnerText = textBox1.Text;
            this.webBrowser1.Document.Window.Frames[2].Document.GetElementsByTagName("input")[1].InnerText = textBox2.Text;
            this.webBrowser1.Document.Window.Frames[2].Document.GetElementsByTagName("button")[0].InvokeMember("click");

生成按钮

    this.webBrowser1.Navigate("https://elvis.harman.com/cgi-bin/ticket?TID=" + txtID.Text);
this.webBrowser1.Update();
this.webBrowser1.Refresh();
var codes = this.webBrowser1.Document.GetElementById("field_100").InnerHtml.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Select(m => m.Trim()).ToList(); 
// with this i tried to separate the innerHtml by lines
//and now i try to start scrapping beggining with a following line:
 var ticketLines = codes.Where(m => m.StartsWith("<TD style='"WIDTH: 65px; HEIGHT: 22px; LEFT: 110px'" class=hb-table-cell>"));
List<string> ticketTitles = new List<string>();
            foreach (string line in ticketLines)
            {   
                //select the line from which you want to start scrapping
                int y = codes.IndexOf(line);
                //ticket title
                ticketTitles.Add(codes[y + 1].Substring(codes[y + 1].IndexOf(">") + 1, codes[y + 1].Length - codes[y + 1].IndexOf(">") - 6));
}

我的问题:当我在序列上添加手表时

var codes = this.webBrowser1.Document.GetElementById("field_100").InnerHtml.Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Select(m => m.Trim()).ToList();

我想看到内部HTML文本,如下所示:

<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1806338</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[DI]Unnecessary refinement when an exact address was entered</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-02-02</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-01-20</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>uchendu chibueze</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.210</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>2-Very High</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1806339</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[RPL]unplausible route guidance - using an exit and go back on the previous street</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-02-02</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-01-20</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>dumke marcus md</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.210</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>B(2)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>1-Urgent</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1809964</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[GUIDO]Mismatch of exit signpost.</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-02-02</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>fritz michael</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>NBTevo_H16043A</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-08</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>&nbsp;</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1809503</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[DB][RPL][COMP] Split screen stuck in E-branch</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-02-05</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-02-05</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>SUngureanu</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.213</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>MLangfeldt</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>SW_SubmitPool</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-05</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>&nbsp;</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1795960</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[POI]Missing second half of postal code [XMAS15](BI8)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-01-18</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2015-12-28</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>uchendu chibueze</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.210</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>2-Very High</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1795961</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[DB] [RPL][ID5] unplausible route guidance guiding suggest to use side street in FWY intersection</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-01-18</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-01-04</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>dumke marcus md</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.210</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>B(2)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>1-Urgent</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1790333</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[DB] RT icon is missing for Route 3 [XMAS15]</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-01-09</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2015-12-29</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>fritz michael</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.210</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-08</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>&nbsp;</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1783168</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[GUIDA] System announced Connecticut 111, but roadbook listed Main Street.-[USDTSV_1534]</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2015-12-18</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2015-10-24</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>fritz michael</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111151.1.230</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-08</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>2-Very High</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1790337</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[GUIDO]realistic road sign missing text [XMAS15]</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-01-09</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-01-05</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>uchendu chibueze</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.3.210</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>&nbsp;</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1772458</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>Content for Exit 73 realistic road sign is not grayed out [req_ID5]</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2015-12-03</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2015-11-24</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>foerster felix f</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>111153.1.220</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>IModoleev</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>&nbsp;</TD></TR>
<TR style="LINE-HEIGHT: 22px; WIDTH: 100%" class=hb-ui-grid-row>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 0px" class=hb-table-cell>
<DIV class=hb-ui-calendar></DIV></TD>
<TD style="WIDTH: 25px; HEIGHT: 22px; LEFT: 25px" class=hb-table-cell>
<DIV class=hb-ui-attachment></DIV></TD>
<TD style="WIDTH: 60px; HEIGHT: 22px; LEFT: 50px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 65px; HEIGHT: 22px; LEFT: 110px" class=hb-table-cell>1808873</TD>
<TD style="WIDTH: 542px; HEIGHT: 22px; LEFT: 175px" class=hb-table-cell>[MAP] Navi announced to bear left, at the same time it shows me to exit right</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 717px" class=hb-table-cell>2016-02-04</TD>
<TD style="WIDTH: 84px; HEIGHT: 22px; LEFT: 812px" class=hb-table-cell>2016-02-02</TD>
<TD style="WIDTH: 132px; HEIGHT: 22px; LEFT: 896px" class=hb-table-cell>bonk markus</TD>
<TD style="WIDTH: 118px; HEIGHT: 22px; LEFT: 1028px" class=hb-table-cell>NBTevo_G15521B</TD>
<TD style="WIDTH: 126px; HEIGHT: 22px; LEFT: 1146px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 16px; HEIGHT: 22px; LEFT: 1272px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 31px; HEIGHT: 22px; LEFT: 1288px" class=hb-table-cell>&nbsp;</TD>
<TD style="WIDTH: 162px; HEIGHT: 22px; LEFT: 1319px" class=hb-table-cell>BMW_Abgleich</TD>
<TD style="WIDTH: 73px; HEIGHT: 22px; LEFT: 1481px" class=hb-table-cell>Entered</TD>
<TD style="WIDTH: 102px; HEIGHT: 22px; LEFT: 1554px" class=hb-table-cell>SW_SubmitPool</TD>
<TD style="WIDTH: 99px; HEIGHT: 22px; LEFT: 1656px" class=hb-table-cell>Categorizing</TD>
<TD style="WIDTH: 86px; HEIGHT: 22px; LEFT: 1755px" class=hb-table-cell>2016-02-06</TD>
<TD style="WIDTH: 64px; HEIGHT: 22px; LEFT: 1841px" class=hb-table-cell>C(3)</TD>
<TD style="WIDTH: 95px; HEIGHT: 22px; LEFT: 1905px" class=hb-table-cell>3-High</TD></TR></TBODY></TABLE></DIV>
<DIV style="WIDTH: 18px; HEIGHT: 236px; TOP: 0px; LEFT: 1072px" class=hb-grid-scroll-vertical unselectable="on" closure_uid_seyus8="64">
<DIV style="WIDTH: 1px; HEIGHT: 58765px; TOP: 0px; LEFT: 0px" unselectable="on"></DIV></DIV>
<DIV style="WIDTH: 1052px; HEIGHT: 18px; TOP: 236px; LEFT: 20px" class=hb-grid-scroll-horizontal unselectable="on" closure_uid_seyus8="65">
<DIV style="WIDTH: 2095px; HEIGHT: 1px; TOP: 0px; LEFT: 0px" unselectable="on"></DIV></DIV></DIV>
<DIV hideFocus class="goog-toolbar goog-toolbar-horizontal" role=toolbar yH="toolbar" unselectable="on" closure_uid_seyus8="97">
<DIV id=:2d class="hb-toolbar-label goog-inline-block" tabIndex=0 unselectable="on" closure_uid_seyus8="73">Mode:</DIV>
<DIV aria-haspopup=true id=:2i class="goog-inline-block goog-toolbar-menu-button" title="" role=button tabIndex=0 yH="button" unselectable="on" closure_uid_seyus8="75">
<DIV class="goog-inline-block goog-toolbar-menu-button-outer-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-menu-button-inner-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-menu-button-caption" unselectable="on">All</DIV>
<DIV class="goog-inline-block goog-toolbar-menu-button-dropdown" unselectable="on">&nbsp;</DIV></DIV></DIV></DIV>
<DIV style="DISPLAY: none" id=:2j class="goog-toolbar-separator goog-inline-block" role=separator yH="separator" unselectable="on">&nbsp;</DIV>
<DIV style="DISPLAY: none" id=:2k class="goog-inline-block goog-toolbar-button" title="First page" role=button yH="button" unselectable="on" closure_uid_seyus8="78">
<DIV class="goog-inline-block goog-toolbar-button-outer-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-button-inner-box" unselectable="on">
<DIV class="icon hb-grid-first" unselectable="on"></DIV></DIV></DIV></DIV>
<DIV style="DISPLAY: none" id=:2l class="goog-inline-block goog-toolbar-button" title="Previous page" role=button yH="button" unselectable="on" closure_uid_seyus8="80">
<DIV class="goog-inline-block goog-toolbar-button-outer-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-button-inner-box" unselectable="on">
<DIV class="icon hb-grid-left" unselectable="on"></DIV></DIV></DIV></DIV>
<DIV style="DISPLAY: none" id=:2m class="hb-toolbar-label goog-inline-block" unselectable="on" closure_uid_seyus8="82">Page</DIV><INPUT style="DISPLAY: none" id=:2n class="hb-toolbar-editor goog-inline-block" value=1 maxLength=4 size=2 type=text closure_uid_seyus8="84">
<DIV style="DISPLAY: none" id=:2o class="hb-toolbar-label goog-inline-block" unselectable="on" closure_uid_seyus8="86">of 16</DIV>
<DIV style="DISPLAY: none" id=:2p class="goog-inline-block goog-toolbar-button" title="Next page" role=button yH="button" unselectable="on" closure_uid_seyus8="88">
<DIV class="goog-inline-block goog-toolbar-button-outer-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-button-inner-box" unselectable="on">
<DIV class="icon hb-grid-right" unselectable="on"></DIV></DIV></DIV></DIV>
<DIV style="DISPLAY: none" id=:2q class="goog-inline-block goog-toolbar-button" title="Last page" role=button yH="button" unselectable="on" closure_uid_seyus8="90">
<DIV class="goog-inline-block goog-toolbar-button-outer-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-button-inner-box" unselectable="on">
<DIV class="icon hb-grid-last" unselectable="on"></DIV></DIV></DIV></DIV>
<DIV id=:2r class="goog-toolbar-separator goog-inline-block" role=separator yH="separator" unselectable="on">&nbsp;</DIV>
<DIV id=:2s class="goog-inline-block goog-toolbar-button" title=Refresh role=button tabIndex=0 yH="button" unselectable="on" closure_uid_seyus8="92">
<DIV class="goog-inline-block goog-toolbar-button-outer-box" unselectable="on">
<DIV class="goog-inline-block goog-toolbar-button-inner-box" unselectable="on">
<DIV class="icon icon hb-grid-refresh" unselectable="on"></DIV></DIV></DIV></DIV>
<DIV id=:2t class="goog-toolbar-separator goog-inline-block" role=separator yH="separator" unselectable="on">&nbsp;</DIV>
<DIV style="COLOR: black" id=:2u class="hb-toolbar-label goog-inline-block" tabIndex=0 unselectable="on" closure_uid_seyus8="94">2554 tickets found</DIV></DIV

我的问题:

  • 在我的文本框中输入 TicketID 并按 button_2("生成"(后,页面不会刷新,并且显示主票证列表而不是指定的票证条目。
  • 我正在尝试通过票证 ID 废弃这个内部 html 文件,正如您在内部 html 文件中所看到的那样。例如,我正在尝试查看票证1806338并提取诸如标题,创建于,发布在innerHtml文件的下一行中的信息。

有人可以给我一个提示或其他东西吗?我也尝试使用HtmlAgilityPack和Selenium报废,但只有Web浏览器我设法做到了这一点。谢谢!

使用网络浏览器在 InnerHtml 文件中搜索某些字符串

我设法解决了这个问题,我将在这里发布它,以便这篇文章应该有一个理由:)

foreach (string line in ticketLines)
            {   
                if (line.Contains(searchkeys)) 
                {
                    //daca se gaseste ce e in txtID se ia indexul liniei si il bag in txtTitle.text
                    int y = codes.IndexOf(line);
                    txtTitle.Text = codes[y+1].Substring(codes[y + 1].IndexOf(">") + 1, codes[y + 1].Length - codes[y + 1].IndexOf(">") - 6);
                    txtCreatedAt.Text = codes[y + 3].Substring(codes[y + 3].IndexOf(">") + 1, codes[y + 3].Length - codes[y + 3].IndexOf(">") - 6);
                    txtCreatedBy.Text = codes[y + 4].Substring(codes[y + 4].IndexOf(">") + 1, codes[y + 4].Length - codes[y + 4].IndexOf(">") - 6);
                    break;
                }

            }