dimanche 23 juillet 2017

Get logged in website specific text

Sorry for my bad English guys :D

this is my code for login to website

webBrowser1.Document.GetElementById("login_username").SetAttribute("value", textBox1.Text);
        webBrowser1.Document.GetElementById("login_password").SetAttribute("value", textBox2.Text);
        webBrowser1.Document.GetElementById("login_submit").InvokeMember("click");

and then i use:

HtmlAgilityPack.HtmlWeb web = new HtmlAgilityPack.HtmlWeb();
            HtmlAgilityPack.HtmlDocument doc = web.Load("http://wzone.ir/");
            var HeaderNames = doc.DocumentNode.SelectNodes("//*[@id=\"info_dp\"]");
            foreach (var item in HeaderNames)
            {
                label1.Text =  item.InnerText.ToString();
            }

this code for getting the text but the program freezes and do nothing :/




Aucun commentaire:

Enregistrer un commentaire