Example #1
0
        private async Task <TEntity> GetDataAsync(IElementHandle element)
        {
            var entity = new TEntity();

            var title = await element.QuerySelectorAsync("a.gs-title");

            if (title == null)
            {
                return(entity);
            }

            entity.Url = await title.EvaluateAsync <string>("e => e.getAttribute('href')");

            var innerText = await element.EvaluateAsync <string>("e => e.innerText");

            entity.Description = innerText;
            entity.Photo       = await GetPhoto(element);

            return(entity);
        }
Example #2
0
        private async Task GetData(IPage page, IElementHandle element)
        {
            var innerText = await element.EvaluateAsync <string>("e => e.innerText");

            Console.WriteLine(innerText);
        }