Beispiel #1
0
        /// <summary>
        /// Process a URL
        /// </summary>
        /// <param name="page">the URL to process</param>
        private void ProcessPage(string page)
        {
            ParseHTML parse = new ParseHTML();

            parse.Source = page;

            while (!parse.Eof())
            {
                char ch = parse.Parse();
                if (ch == 0)
                {
                    Tag tag = parse.GetTag();
                    // m_spider.Log("Tag name: " + tag.Name);

                    //  TODO - Make this use real .NET events someday
                    foreach (DocumentWorkerListener dwl in m_spider.Listeners)
                    {
                        dwl.HandleTagEvent(m_spider.BaseURI, tag);
                    }

                    Attribute a = tag.Attributes["HREF"];
                    if (a != null)
                    {
                        ProcessLink(a.Value);
                    }

                    a = tag.Attributes["SRC"];
                    if (a != null)
                    {
                        ProcessLink(a.Value);
                    }
                }
            }
        }
Beispiel #2
0
		/// <summary>
		/// Process a URL
		/// </summary>
		/// <param name="page">the URL to process</param>
		private void ProcessPage(string page)
		{
			ParseHTML parse = new ParseHTML();
			parse.Source = page;

			while(!parse.Eof())
			{
				char ch = parse.Parse();
				if(ch==0)
				{
                    Tag tag = parse.GetTag();
                    // m_spider.Log("Tag name: " + tag.Name);

                    //  TODO - Make this use real .NET events someday
                    foreach (DocumentWorkerListener dwl in m_spider.Listeners)
                    {
                        dwl.HandleTagEvent(m_spider.BaseURI, tag);
                    }

					Attribute a = tag.Attributes["HREF"];
					if( a!=null )
						ProcessLink(a.Value);
					
					a = tag.Attributes["SRC"];
					if( a!=null )
						ProcessLink(a.Value);
				}
			}
		}