Ejemplo n.º 1
0
        /// <summary>
        /// Gets all the page urls from the first page
        /// the value of all of the urls will be used to grab
        /// all the html pages
        /// </summary>
        /// <param name="baseUrl"></param>
        /// <param name="paginatorXpath"></param>
        /// <param name="builder"></param>
        /// <returns></returns>
        public bool FetchPageUrls(string baseUrl, string paginatorXpath, ElementBuilder builder)
        {
            var document = new Document();

            document.StartPage(baseUrl);
            var doc   = document.Pages[0];
            var links = doc.DocumentNode.SelectNodes(paginatorXpath);

            if (!LinksExists(paginatorXpath, doc))
            {
                return(false);
            }
            GetNodes(builder, links.Select(x => x.Attributes["href"].Value).ToArray());
            return(true);
        }
 // Builder uses a complex series of steps
 public void Construct(ElementBuilder YelpBuilder)
 {
     YelpBuilder.BuildElementDictonary();
 }