Beispiel #1
0
        private void ParseUrl(string url, int level)
        {
            if (this._level != 0 && this._level < level)
            {
                return;
            }

            List <string> urls = this._urlExtract.Execute(url);

            if (string.IsNullOrEmpty(this._urlExtract.GetExceptionMessage()))
            {
                _extractListener.Succeeded(url, this._urlExtract.GetHtmlContent(), level, urls);
            }
            else
            {
                _extractListener.Error(url, level, this._urlExtract.GetExceptionMessage());
            }

            if (urls != null && urls.Count > 0)
            {
                urls.Remove(url);
                foreach (var item in urls)
                {
                    this.ParseUrl(item, level + 1);
                }
            }
        }