Exemplo n.º 1
0
 public Crawler(int pageCount = 100, int wordCouny = 1000)
 {
     PageCount = pageCount;
     WordCount = wordCouny;
     CreateForder();
     htmlParser = new HtmlParser.HtmlParser();
     httpClient = new HttpClient();
     httpClient.DefaultRequestHeaders.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36");
 }
Exemplo n.º 2
0
        private void btnQuery_Click(object sender, EventArgs e)
        {
            trParsedURL.Nodes.Clear();
            if (txtURL.Text == String.Empty)
                return;

            HtmlParser.HtmlParser parser = new HtmlParser.HtmlParser();
            if (!parser.ParseURL(txtURL.Text, true, new string[] {"<br>"}))
                return;

            parser.PopulateTreeView(ref this.trParsedURL);
            trParsedURL.ExpandAll();
        }