public WebHelpers(Util.AppSettings settings)
 {
     _settings                  = settings;
     _wb                        = new ScreenCaptureMagic.Util.WebBrowser();
     _wb.ScrollBarsEnabled      = false;
     _wb.ScriptErrorsSuppressed = true;
     _wb.AllowNavigation        = true;
 }
Exemplo n.º 2
0
 public WebHelpers(Util.AppSettings settings)
 {
     _settings = settings;
     _wb = new ScreenCaptureMagic.Util.WebBrowser();
     _wb.ScrollBarsEnabled = false;
     _wb.ScriptErrorsSuppressed = true;
     _wb.AllowNavigation = true;
 }
        public static bool checkForFlash(ScreenCaptureMagic.Util.WebBrowser wb)
        {
            string page_text = wb.DocumentText.ToLower();

            if ((page_text.Contains("object") &&
                 page_text.Contains("param name=\"movie\"")) ||
                (page_text.Contains("swfobject(")))
            {
                return(true);
            }
            return(false);
        }
        public static List <string> scrapeMeta(ScreenCaptureMagic.Util.WebBrowser wb)
        {
            List <string> meta = new List <string>();

            Regex metaregex =
                new Regex(@"<meta\s*(?:(?:\b(\w|-)+\b\s*(?:=\s*(?:""[^""]*""|'" +
                          @"[^']*'|[^""'<> ]+)\s*)?)*)/?\s*>",
                          RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture);

            foreach (Match metamatch in metaregex.Matches(wb.DocumentText))
            {
                string val = metamatch.Value.Replace("<", "");
                val = val.Replace(">", "");
                meta.Add(val);
            }

            return(meta);
        }