示例#1
0
        public static string[] ToValues(string html, string objectSelector, string propertySelector)
        {
            var htmlObjectSelector   = SelectorCache.GetOrAddObject(objectSelector);
            var htmlNodes            = htmlObjectSelector.Execute(html);
            var htmlPropertySelector = SelectorCache.GetOrAddProperty(propertySelector);

            return(htmlNodes.Select(htmlPropertySelector.Execute).ToArray());
        }
示例#2
0
 protected internal void SetInternal <TProperty>(PropertyInfo propertyInfo, string propertySelector, Func <string, TProperty> propertyValueParser)
 {
     AddSetter((htmlNode, currentObject) =>
     {
         var htmlPropertySelector  = SelectorCache.GetOrAddProperty(propertySelector);
         var executedPropertyValue = htmlPropertySelector.Execute(htmlNode);
         var parsedPropertyValue   = propertyValueParser(executedPropertyValue);
         propertyInfo.SetValue(currentObject, parsedPropertyValue);
     });
 }
示例#3
0
        public static string ToValue(string html, string selector)
        {
            var htmlSelector = SelectorCache.GetOrAddProperty(selector);

            return(htmlSelector.Execute(html));
        }