示例#1
0
        private void HandleLinks(WebPageState state)
        {
            Match m = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, state.Content);

            while (m.Success)
            {
                ManualProcessorLinksCounter++;
                m = m.NextMatch( );
            }
        }
示例#2
0
        private void HandleLinks(WebPageState state)
        {
            string html = state.Content;
            Match  m    = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, html);

            while (m.Success)
            {
                m_spider.AddWebPage(state.Uri, m.Groups["url"].ToString( ));

                m = m.NextMatch( );
            }
        }
        private void GraphicsLinkHandler(WebPageState state)
        {
            Match  m = RegExUtil.GetMatchRegEx(RegularExpression.SrcExtractor, state.content_);
            string image;

            while (m.Success)
            {
                m     = m.NextMatch();
                image = m.Groups[1].ToString();

                statusBar.Text = "Image: " + image;
                Application.DoEvents();

                DownloadImage(image);
            }
        }
        public void HandleLinks(WebPageState state)
        {
            if (state.processInstructions_.IndexOf("Handle Links") != -1)
            {
                int   counter = 0;
                Match m       = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, state.content_);

                while (m.Success)
                {
                    if (AddWebPage(state.uri_, m.Groups["url"].ToString()))
                    {
                        counter++;
                    }

                    m = m.NextMatch();
                }
            }
        }
示例#5
0
        public void HandleLinks(WebPageState state)
        {
            if (state.ProcessInstructions.IndexOf("Handle Links") != -1)
            {
                int   counter = 0;
                Match m       = RegExUtil.GetMatchRegEx(RegularExpression.UrlExtractor, state.Content);

                while (m.Success)
                {
                    if (AddWebPage(state.Uri, m.Groups["url"].ToString( )))
                    {
                        counter++;
                    }

                    m = m.NextMatch( );
                }

                Console.WriteLine("           : {0} new links were added", counter);
            }
        }