Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- htmlWeb hw = new HtmlWeb();
- if (txtCurrentURL.Text == "")
- {
- MessageBox.Show(" Enter Web Address to Process ");
- }
- else
- {
- HtmlAgilityPack.HtmlDocument htmlDoc = hw.Load(@txtCurrentURL.Text);
- if (htmlDoc.DocumentNode != null)
- {
- try
- { foreach (HtmlNode text in htmlDoc.DocumentNode.SelectNodes(txtExpression.Text))
- {
- _items.Add(text.InnerHtml);
- richTextResults.Text = text.InnerHtml;
- } }
- catch
- { MessageBox.Show(" No Usefull Data found");
- }
- lstBxResult.DataSource = _items;
- }
- }
- private HtmlWeb CreateWebRequestObject()
- {
- HtmlWeb web = new HtmlWeb();
- web.UseCookies = true;
- web.PreRequest = new HtmlWeb.PreRequestHandler(PreRequestStuff);
- web.PostResponse = new HtmlWeb.PostResponseHandler(AfterResponseStuff);
- web.PreHandleDocument = new HtmlWeb.PreHandleDocumentHandler(PreHandleDocumentStuff);
- return web;
- }
Add Comment
Please, Sign In to add comment