public LinkStatus ExtractLinks() { if (String.Empty == m_strUrl) { throw new ArgumentException("No URL specified"); } m_Links = new ImageDataCollection(); CreateParser(); if (m_obParser.Lexer.Page.mSource == null) { return LinkStatus.Broken; } INodeFilter obFilter = new NodeClassFilter(typeof(ImageTag)); NodeList collNodes = m_obParser.Parse(obFilter); if (null != collNodes) { PageData obPageData = new PageData(); obPageData.m_strUrl = m_obParser.URL; obPageData.m_iDepth = m_iLevel; for(Int32 i= 0; i < collNodes.Count; i++) { INode obNode = collNodes[i]; ImageData obLinkData = new ImageData(obPageData, obNode as ImageTag); m_Links.Add(obLinkData); } } return LinkStatus.Ok; }
/// <summary> /// Creates new instance of <see cref="PageData"></see> object. /// </summary> public PageData() { m_HeaderData = new HeadData(); m_Outlinks = new LinkDataCollection(); m_ImageLinks = new ImageDataCollection(); m_Cookies = new CookieCollection(); m_Tables = new TableDataCollection(); }