How to get data from a table in a website?

3

I'm developing a program that captures the proxies and ports of this site, for the program to get the proxies I used regular expression and htmlagilitypack ... But how to get the doors? Since by expressions I would end up getting numbers that are not proxies?

var search = webBrowser1.Document.GetElementsByTagName("table");
        foreach (HtmlElement ele in search)
        {
            HtmlElement h2 = ele.Parent.FirstChild;
            if (h2.InnerText == "IP Address")
            {
                DataTable table = new DataTable();
                table.Columns.Add("IP");
                table.Columns.Add("Porta");

                HtmlElement tableBody = ele.FirstChild;
                foreach (HtmlElement tableRow in tableBody.Children)
                {

                    HtmlElement _IP = tableRow.FirstChild;

                    HtmlElement _Porta = _IP.NextSibling.NextSibling;

                    DataRow row = table.NewRow();

                    row[0] = _IP.InnerText;

                    row[1] = _Porta.InnerText;

                    table.Rows.Add(row);
                }
                dataGridView1.DataSource = table;
            }
        }
    
asked by anonymous 04.09.2018 / 10:25

0 answers