Exemple #1
0
        public void Process(Crawler crawler, PropertyBag propertyBag)
        {
            if (propertyBag["HtmlDoc"].Value == null)
            {
                return;
            }

            string gender  = "gender";
            string age_min = "age_min";
            string age_max = "age_max";
            string start   = "start";

            gender  += "=" + CrawlUtil.getQueryValueFromUrl(propertyBag.ResponseUri.AbsoluteUri, gender);
            age_min += "=" + CrawlUtil.getQueryValueFromUrl(propertyBag.ResponseUri.AbsoluteUri, age_min);
            age_max += "=" + CrawlUtil.getQueryValueFromUrl(propertyBag.ResponseUri.AbsoluteUri, age_max);
            start   += "=" + CrawlUtil.getQueryValueFromUrl(propertyBag.ResponseUri.AbsoluteUri, start);

            ReviewCrawler.MainForm.appendLineToLog(propertyBag.Title);
            ReviewCrawler.MainForm.appendLineToLog(gender);
            ReviewCrawler.MainForm.appendLineToLog(age_min);
            ReviewCrawler.MainForm.appendLineToLog(age_max);
            ReviewCrawler.MainForm.appendLineToLog(start);

            HtmlAgilityPack.HtmlDocument doc = propertyBag["HtmlDoc"].Value as HtmlAgilityPack.HtmlDocument;

            doc.Save("HtmlDump/"
                     + CrawlUtil.SanitiseFileName(CrawlUtil.getMovieNameFromTitle(HttpUtility.HtmlDecode(propertyBag.Title)))
                     + "#" + gender
                     + "#" + age_min
                     + "#" + age_max
                     + "#" + start
                     + ".html");
        }
Exemple #2
0
 private void txtSaveFileName_TextChanged(object sender, EventArgs e)
 {
     txtSaveFileName.Text = CrawlUtil.SanitiseFileName(txtSaveFileName.Text);
     this._SaveFileName   = txtSaveFileName.Text;
 }